summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-12-09 11:12:51 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-12-09 11:12:51 +0000
commit2fa86e4938b55d06a6b1e8d394b420e42c7712d5 (patch)
tree988717b558c4cdc40ca242e674582a1a72815098 /usr.sbin
parentc6786e14269d4c64baf159a7f5dce97f6f91c2bf (diff)
parsecommunity() does not allow to set unknown well-known communities.
So there is no need to check that again. Switch a USHRT_MAX to COMMUNITY_WELLKNOWN to make the compare clearer, the values are the same.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/parse.y21
1 files changed, 2 insertions, 19 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index fb5400eefcf..2411aaac8d8 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.243 2009/12/08 14:03:40 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.244 2009/12/09 11:12:50 claudio Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1792,23 +1792,6 @@ filter_set_opt : LOCALPREF NUMBER {
free($$);
YYERROR;
}
- /* Don't allow setting of unknown well-known types */
- if ($$->action.community.as == COMMUNITY_WELLKNOWN) {
- switch ($$->action.community.type) {
- case COMMUNITY_NO_EXPORT:
- case COMMUNITY_NO_ADVERTISE:
- case COMMUNITY_NO_EXPSUBCONFED:
- case COMMUNITY_NO_PEER:
- /* valid */
- break;
- default:
- /* unknown */
- yyerror("Invalid well-known community");
- free($$);
- YYERROR;
- break;
- }
- }
}
| ORIGIN origincode {
if (($$ = calloc(1, sizeof(struct filter_set))) == NULL)
@@ -2557,7 +2540,7 @@ parsecommunity(char *s, int *as, int *type)
if ((i = getcommunity(s)) == COMMUNITY_ERROR)
return (-1);
- if (i == USHRT_MAX) {
+ if (i == COMMUNITY_WELLKNOWN) {
yyerror("Bad community AS number");
return (-1);
}