summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bgpctl/parser.c
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2008-08-31 08:29:35 +0000
committerclaudio <claudio@openbsd.org>2008-08-31 08:29:35 +0000
commitc85f4e49323456ab34f56c7a814e5a58ab7066fe (patch)
tree5a0b5221c78aacc29f8ec0022efa25873a95c956 /usr.sbin/bgpctl/parser.c
parentreplace TRUNC_PAGE by trunc_page and ROUND_PAGE by round_page (diff)
downloadwireguard-openbsd-c85f4e49323456ab34f56c7a814e5a58ab7066fe.tar.xz
wireguard-openbsd-c85f4e49323456ab34f56c7a814e5a58ab7066fe.zip
Fix AS check in parse_community() -- well-known communities have the AS
part set to COMMUNITY_WELLKNOWN which is the same as USHRT_MAX. Figured out by Greg Skinner
Diffstat (limited to 'usr.sbin/bgpctl/parser.c')
-rw-r--r--usr.sbin/bgpctl/parser.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/bgpctl/parser.c b/usr.sbin/bgpctl/parser.c
index 3bb988847be..c60164cd926 100644
--- a/usr.sbin/bgpctl/parser.c
+++ b/usr.sbin/bgpctl/parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.c,v 1.50 2008/06/15 09:58:43 claudio Exp $ */
+/* $OpenBSD: parser.c,v 1.51 2008/08/31 08:29:35 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -801,7 +801,7 @@ parse_community(const char *word, struct parse_result *r)
type = getcommunity(p);
done:
- if (as == 0 || as == USHRT_MAX) {
+ if (as == 0) {
fprintf(stderr, "Invalid community\n");
return (0);
}
@@ -814,7 +814,7 @@ done:
break;
default:
/* unknown */
- fprintf(stderr, "Invalid well-known community\n");
+ fprintf(stderr, "Unknown well-known community\n");
return (0);
}