diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-10-19 12:02:51 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-10-19 12:02:51 +0000 |
commit | dad2ed0ea2d46300983f4e9cde6008dba2926d1e (patch) | |
tree | 1d33e1002e97ab67386bd63daa50de6a21566c2d /usr.sbin/bgpd/parse.y | |
parent | 7624dce6c878f38e238494751c696fb265e11e2b (diff) |
allow neighbor definitions to depend on interface state.
with this, if a neighbor is configured as dependent on carp0 for example,
the neighbor will remain in state IDLE as long as carp0 is not master.
once carp0 becomes master the session(s) depending on it immediately
go to CONNECT (or ACTIVE, if they're configured passive), reducing failover
time. claudio ok, with some input from ryan as well
Diffstat (limited to 'usr.sbin/bgpd/parse.y')
-rw-r--r-- | usr.sbin/bgpd/parse.y | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y index 2c257a2de7c..6634244a094 100644 --- a/usr.sbin/bgpd/parse.y +++ b/usr.sbin/bgpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.140 2004/09/28 12:09:31 claudio Exp $ */ +/* $OpenBSD: parse.y,v 1.141 2004/10/19 12:02:50 henning Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -139,7 +139,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 CAPABILITIES REFLECTOR +%token ENFORCE NEIGHBORAS CAPABILITIES REFLECTOR DEPEND %token DUMP IN OUT %token LOG ROUTECOLL %token TCP MD5SIG PASSWORD KEY @@ -740,6 +740,18 @@ peeropts : REMOTEAS asnumber { curpeer->conf.reflector_client = 1; conf->clusterid = $2.v4.s_addr; } + | DEPEND ON STRING { + if (strlcpy(curpeer->conf.if_depend, $3, + sizeof(curpeer->conf.if_depend)) >= + sizeof(curpeer->conf.if_depend)) { + yyerror("interface name \"%s\" too long: " + "max %u", $3, + sizeof(curpeer->conf.if_depend) - 1); + free($3); + YYERROR; + } + free($3); + } ; espah : ESP { $$ = 1; } @@ -1213,6 +1225,7 @@ lookup(char *s) { "capabilities", CAPABILITIES}, { "community", COMMUNITY}, { "deny", DENY}, + { "depend", DEPEND}, { "descr", DESCR}, { "dump", DUMP}, { "enforce", ENFORCE}, |