summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2006-02-09 16:08:29 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2006-02-09 16:08:29 +0000
commitd57aef148afa0cc5051c6239ff7c52cb50634681 (patch)
tree6be1b535e30c8faca87f12be54b9a3cb2a602450
parent1641cf6afc5a06ba81a6d5deb226724bf447cec8 (diff)
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);