summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2006-02-09 16:08:28 +0000
committerclaudio <claudio@openbsd.org>2006-02-09 16:08:28 +0000
commit94b0675cd6f53de3762ab71f68dda71151572ae9 (patch)
treef41b99df31a92ac94823386968ac0b3cf15ad5e3
parentPrevent the neighbor FSM from getting stuck forever in state EXSTART. (diff)
downloadwireguard-openbsd-94b0675cd6f53de3762ab71f68dda71151572ae9.tar.xz
wireguard-openbsd-94b0675cd6f53de3762ab71f68dda71151572ae9.zip
inet_pton() may return 1, 0 or -1. Only 1 is success so check explicitly
for it. OK henning@
-rw-r--r--usr.sbin/bgpctl/parser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/bgpctl/parser.c b/usr.sbin/bgpctl/parser.c
index d72afbdf784..ce689fac66d 100644
--- a/usr.sbin/bgpctl/parser.c
+++ b/usr.sbin/bgpctl/parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.c,v 1.27 2006/01/24 15:28:03 henning Exp $ */
+/* $OpenBSD: parser.c,v 1.28 2006/02/09 16:08:28 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -513,7 +513,7 @@ parse_addr(const char *word, struct bgpd_addr *addr)
bzero(addr, sizeof(struct bgpd_addr));
bzero(&ina, sizeof(ina));
- if (inet_pton(AF_INET, word, &ina)) {
+ if (inet_pton(AF_INET, word, &ina) == 1) {
addr->af = AF_INET;
addr->v4 = ina;
return (1);