summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/parse.y
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2004-02-26 14:00:34 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2004-02-26 14:00:34 +0000
commit11a180c99e46f36231edf3068b2a427969f69411 (patch)
tree8230d636d704aeee6f6653ca69945b4673fda63b /usr.sbin/bgpd/parse.y
parent8f7a65223ef60cf679511eed6084ba0d67d363e2 (diff)
Implement "enforce neighbor-as yes|no" which is by default on for ebgp
neighbors. While doing that check also that the nexthop is valid (not class D or E and not in 127/8 range). Kill some TODO and XXX and rename the british neighbour to neighbor as used everywhere else. OK henning@
Diffstat (limited to 'usr.sbin/bgpd/parse.y')
-rw-r--r--usr.sbin/bgpd/parse.y11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index e77a5193242..b7119fa6d2d 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.62 2004/02/26 13:54:50 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.63 2004/02/26 14:00:33 claudio Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -100,6 +100,7 @@ typedef struct {
%token AS ROUTERID HOLDTIME YMIN LISTEN ON FIBUPDATE
%token GROUP NEIGHBOR NETWORK
%token REMOTEAS DESCR LOCALADDR MULTIHOP PASSIVE MAXPREFIX ANNOUNCE
+%token ENFORCE NEIGHBORAS
%token DUMP TABLE IN OUT
%token LOG
%token TCP MD5SIG PASSWORD KEY
@@ -393,6 +394,12 @@ peeropts : REMOTEAS number {
YYERROR;
}
}
+ | ENFORCE NEIGHBORAS yesno {
+ if ($3)
+ curpeer->conf.enforce_as = ENFORCE_AS_ON;
+ else
+ curpeer->conf.enforce_as = ENFORCE_AS_OFF;
+ }
| MAXPREFIX number {
curpeer->conf.max_prefix = $2;
}
@@ -681,6 +688,7 @@ lookup(char *s)
{ "deny", DENY},
{ "descr", DESCR},
{ "dump", DUMP},
+ { "enforce", ENFORCE},
{ "fib-update", FIBUPDATE},
{ "from", FROM},
{ "group", GROUP},
@@ -697,6 +705,7 @@ lookup(char *s)
{ "med", MED},
{ "min", YMIN},
{ "multihop", MULTIHOP},
+ { "neighbor-as", NEIGHBORAS},
{ "neighbor", NEIGHBOR},
{ "network", NETWORK},
{ "nexthop", NEXTHOP},