aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2023-04-14 15:18:18 +0200
committerMaria Matejka <mq@ucw.cz>2023-04-14 15:18:18 +0200
commit61e64d6a4119c32e0fa1b03285f805e21a00f6ab (patch)
tree60bf261c10d0260e1e9d9265b10ca5fd33f67e6a
parent0c9e33fa7ae2bf0c0adb94c6ef9a446913ed50b8 (diff)
parent9e44ace3928a19560058dc713fcbff3a8bad3b3c (diff)
downloadbird-61e64d6a4119c32e0fa1b03285f805e21a00f6ab.tar.gz
Merge commit '9e44ace3' into thread-next-iface
-rw-r--r--doc/bird.sgml15
-rw-r--r--proto/bgp/attrs.c2
-rw-r--r--proto/bgp/bgp.h1
-rw-r--r--proto/bgp/config.Y1
-rw-r--r--test/birdtest.h2
5 files changed, 15 insertions, 6 deletions
diff --git a/doc/bird.sgml b/doc/bird.sgml
index b36e81f3..c8f80c46 100644
--- a/doc/bird.sgml
+++ b/doc/bird.sgml
@@ -2650,12 +2650,19 @@ using the following configuration parameters:
keeps MED attribute). Default: disabled.
<tag><label id="bgp-allow-local-pref">allow bgp_local_pref <m/switch/</tag>
- A standard BGP implementation do not send the Local Preference attribute
- to eBGP neighbors and ignore this attribute if received from eBGP
+ Standard BGP implementations do not send the Local Preference attribute
+ to EBGP neighbors and ignore this attribute if received from EBGP
neighbors, as per <rfc id="4271">. When this option is enabled on an
- eBGP session, this attribute will be sent to and accepted from the peer,
+ EBGP session, this attribute will be sent to and accepted from the peer,
which is useful for example if you have a setup like in <rfc id="7938">.
- The option does not affect iBGP sessions. Default: off.
+ The option does not affect IBGP sessions. Default: off.
+
+ <tag><label id="bgp-allow-med">allow bgp_med <m/switch/</tag>
+ Standard BGP implementations do not propagate the MULTI_EXIT_DESC
+ attribute unless it is configured locally. When this option is enabled
+ on an EBGP session, this attribute will be sent to the peer regardless,
+ which is useful for example if you have a setup like in <rfc id="7938">.
+ The option does not affect IBGP sessions. Default: off.
<tag><label id="bgp-allow-local-as">allow local as [<m/number/]</tag>
BGP prevents routing loops by rejecting received routes with the local
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index 039fdff5..8bff4c78 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -2154,7 +2154,7 @@ bgp_update_attrs(struct bgp_proto *p, struct bgp_channel *c, rte *e, ea_list *at
/* MULTI_EXIT_DESC attribute - accept only if set in export filter */
a = bgp_find_attr(attrs0, BA_MULTI_EXIT_DISC);
- if (a && !(a->fresh))
+ if (a && !a->fresh && !p->cf->allow_med)
bgp_unset_attr(&attrs, BA_MULTI_EXIT_DISC);
}
diff --git a/proto/bgp/bgp.h b/proto/bgp/bgp.h
index c98582dd..6f75874f 100644
--- a/proto/bgp/bgp.h
+++ b/proto/bgp/bgp.h
@@ -108,6 +108,7 @@ struct bgp_config {
int interpret_communities; /* Hardwired handling of well-known communities */
int allow_local_as; /* Allow that number of local ASNs in incoming AS_PATHs */
int allow_local_pref; /* Allow LOCAL_PREF in EBGP sessions */
+ int allow_med; /* Allow BGP_MED in EBGP sessions */
int allow_as_sets; /* Allow AS_SETs in incoming AS_PATHs */
int enforce_first_as; /* Enable check for neighbor AS as first AS in AS_PATH */
int gr_mode; /* Graceful restart mode (BGP_GR_*) */
diff --git a/proto/bgp/config.Y b/proto/bgp/config.Y
index 8b0d4356..a37bb27a 100644
--- a/proto/bgp/config.Y
+++ b/proto/bgp/config.Y
@@ -200,6 +200,7 @@ bgp_proto:
| bgp_proto ALLOW LOCAL AS ';' { BGP_CFG->allow_local_as = -1; }
| bgp_proto ALLOW LOCAL AS expr ';' { BGP_CFG->allow_local_as = $5; }
| bgp_proto ALLOW BGP_LOCAL_PREF bool ';' { BGP_CFG->allow_local_pref = $4; }
+ | bgp_proto ALLOW BGP_MED bool ';' { BGP_CFG->allow_med = $4; }
| bgp_proto ALLOW AS SETS bool ';' { BGP_CFG->allow_as_sets = $5; }
| bgp_proto GRACEFUL RESTART bool ';' { BGP_CFG->gr_mode = $4; }
| bgp_proto GRACEFUL RESTART AWARE ';' { BGP_CFG->gr_mode = BGP_GR_AWARE; }
diff --git a/test/birdtest.h b/test/birdtest.h
index b8978b3e..cfeebb98 100644
--- a/test/birdtest.h
+++ b/test/birdtest.h
@@ -40,7 +40,7 @@ static inline u64 bt_random(void)
void bt_log_suite_result(int result, const char *fmt, ...);
void bt_log_suite_case_result(int result, const char *fmt, ...);
-#define BT_TIMEOUT 20 /* Default timeout in seconds */
+#define BT_TIMEOUT 60 /* Default timeout in seconds */
#define BT_FORKING 1 /* Forking is enabled in default */
#define BT_RANDOM_SEED 0x5097d2bb