summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/parse.y
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2007-05-31 04:06:05 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2007-05-31 04:06:05 +0000
commit457178550d6d623e3bdb779fb56c93ec291aa971 (patch)
treec1738ba73ef23c63d2d65406b26a9d7d849426b3 /usr.sbin/bgpd/parse.y
parent7ca524b7b1a5a9f6461e627d4bc49d3054897e5f (diff)
Even so some IX in germany likes to abuse 0 as AS community number we should
not allow anybody to use 65535. That one is reserved for well known communities. Add in that check again.
Diffstat (limited to 'usr.sbin/bgpd/parse.y')
-rw-r--r--usr.sbin/bgpd/parse.y6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index d786fc19092..8ddf4713f01 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.205 2007/05/28 17:26:33 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.206 2007/05/31 04:06:04 claudio Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -2270,6 +2270,10 @@ parsecommunity(char *s, int *as, int *type)
if ((i = getcommunity(s)) == COMMUNITY_ERROR)
return (-1);
+ if (i == USHRT_MAX) {
+ yyerror("Bad community AS number");
+ return (-1);
+ }
*as = i;
if ((i = getcommunity(p)) == COMMUNITY_ERROR)