diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-02-02 14:06:06 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-02-02 14:06:06 +0000 |
commit | 77d306336665df0202684ea013b56ccab67d48cb (patch) | |
tree | 652858e3d80d9536217068cbab5d9e8c1e7be628 /usr.sbin/bgpd/parse.y | |
parent | e48d9cd4078b2e4ea1d1d65efef627a69574921f (diff) |
Implement new special community "neighbor-as". neighbor-as is expanded on
the fly to the remote AS of the current neighbor. This can be used to
simplify rulesets in a dramatic way -- going from a script based nightmare
down to a handfull rules. jajajaja henning@
Diffstat (limited to 'usr.sbin/bgpd/parse.y')
-rw-r--r-- | usr.sbin/bgpd/parse.y | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y index b0d61b5260e..504b650e0d2 100644 --- a/usr.sbin/bgpd/parse.y +++ b/usr.sbin/bgpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.178 2006/01/07 14:50:28 claudio Exp $ */ +/* $OpenBSD: parse.y,v 1.179 2006/02/02 14:06:05 claudio Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -1429,6 +1429,12 @@ filter_set_opt : LOCALPREF number { YYERROR; } free($2); + /* Don't allow setting of any match */ + if ($$->action.community.as == COMMUNITY_ANY || + $$->action.community.type == COMMUNITY_ANY) { + yyerror("'*' is not allowed in set community"); + YYERROR; + } /* Don't allow setting of unknown well-known types */ if ($$->action.community.as == COMMUNITY_WELLKNOWN) { switch ($$->action.community.type) { @@ -2013,6 +2019,8 @@ getcommunity(char *s) if (strcmp(s, "*") == 0) return (COMMUNITY_ANY); + if (strcmp(s, "neighbor-as") == 0) + return (COMMUNITY_NEIGHBOR_AS); if (atoul(s, &ulval) == -1) { yyerror("\"%s\" is not a number", s); return (COMMUNITY_ERROR); |