diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2024-08-22 08:17:55 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2024-08-22 08:17:55 +0000 |
commit | 758bcf6d6fc48d641c0eaeccb4eeed64b8cd366a (patch) | |
tree | 772dea4587a938f85cf68b77c7b5e3c6c90aa332 /usr.sbin/bgpctl | |
parent | 4977b3c2d49c3d89437a5afe2a690ac62887d13b (diff) |
inet_pton returns 0 and -1 for error.
Adjust the error check that is now wrong after the inet_aton -> inet_pton
conversion.
Noticed by & OK bluhm.
OK tb
Diffstat (limited to 'usr.sbin/bgpctl')
-rw-r--r-- | usr.sbin/bgpctl/parser.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/bgpctl/parser.c b/usr.sbin/bgpctl/parser.c index ee86917744d..e35a952b46d 100644 --- a/usr.sbin/bgpctl/parser.c +++ b/usr.sbin/bgpctl/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.136 2024/08/21 09:17:05 florian Exp $ */ +/* $OpenBSD: parser.c,v 1.137 2024/08/22 08:17:54 florian Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -1325,7 +1325,7 @@ parseextvalue(int type, char *s, uint32_t *v, uint32_t *flag) *v = uval | (uvalh << 16); break; case EXT_COMMUNITY_TRANS_IPV4: - if (inet_pton(AF_INET, s, &ip) == 0) + if (inet_pton(AF_INET, s, &ip) != 1) errx(1, "Bad ext-community %s not parseable", s); *v = ntohl(ip.s_addr); break; |