summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/parse.y
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2005-08-09 20:27:26 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2005-08-09 20:27:26 +0000
commit6aba2f99d36c0c95e63613146e8344d9256df609 (patch)
treeb76e2f7547be4cda6abcae160da591c9f51dc7bd /usr.sbin/bgpd/parse.y
parent37d43a6ee9cff1651397a00f88f10a313035035f (diff)
Introduce new route decision tunable "rde med compare (always|strict)".
If set to always the med will also be compared between different AS. The default is strict which is the way the RFC specifies it. OK henning@
Diffstat (limited to 'usr.sbin/bgpd/parse.y')
-rw-r--r--usr.sbin/bgpd/parse.y18
1 files changed, 16 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index 8fe1c32ed9d..adb8f4a1115 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.170 2005/07/28 20:01:21 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.171 2005/08/09 20:27:25 claudio Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -142,7 +142,7 @@ typedef struct {
%}
%token AS ROUTERID HOLDTIME YMIN LISTEN ON FIBUPDATE
-%token RDE EVALUATE IGNORE
+%token RDE EVALUATE IGNORE COMPARE
%token GROUP NEIGHBOR NETWORK
%token REMOTEAS DESCR LOCALADDR MULTIHOP PASSIVE MAXPREFIX ANNOUNCE
%token ENFORCE NEIGHBORAS CAPABILITIES REFLECTOR DEPEND
@@ -415,6 +415,19 @@ conf_main : AS asnumber {
}
free($2);
}
+ | RDE MED COMPARE STRING {
+ if (!strcmp($4, "always"))
+ conf->flags |= BGPD_FLAG_DECISION_MED_ALWAYS;
+ else if (!strcmp($4, "strict"))
+ conf->flags &= ~BGPD_FLAG_DECISION_MED_ALWAYS;
+ else {
+ yyerror("rde med compare: "
+ "unknown setting \"%s\"", $4);
+ free($4);
+ YYERROR;
+ }
+ free($4);
+ }
;
mrtdump : DUMP STRING inout STRING optnumber {
@@ -1464,6 +1477,7 @@ lookup(char *s)
{ "blackhole", BLACKHOLE},
{ "capabilities", CAPABILITIES},
{ "community", COMMUNITY},
+ { "compare", COMPARE},
{ "connected", CONNECTED},
{ "deny", DENY},
{ "depend", DEPEND},