summaryrefslogtreecommitdiff
path: root/proto/bgp/bgp.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2018-12-16 23:44:24 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2018-12-16 23:44:24 +0100
commit1cab2b4a7cffb7ad604dcbd200267733ef079973 (patch)
tree0874fe2787c5b05fc0d8259963a65960e6d816eb /proto/bgp/bgp.c
parent337165959c5a556d6556fb2acbba5e7f2b1c35a5 (diff)
BGP: Extend 'next hop keep' and 'next hop self' options
Extend 'next hop keep' and 'next hop self' options to have boolean values (enabled / disabled) and also values 'ibgp'/ 'ebgp' to restrict it to routes received from IBGP / EBGP. This allows to have it enabled by default in some cases, matches features of other implementations, and allows to handle some strange cases like EBGP border router with 'next hop self' also doing IBGP route reflecting. Change default of 'next hop keep' to enabled for route servers, and 'ibgp' for route reflectors. Update documentation for these options.
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r--proto/bgp/bgp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index ae4a1b0a..fb6c9881 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -1814,6 +1814,10 @@ bgp_postconfig(struct proto_config *CF)
if ((cc->c.in_limit.action == PLA_RESTART) && cf->disable_after_error)
cc->c.in_limit.action = PLA_DISABLE;
+ /* Different default based on rr_client, rs_client */
+ if (cc->next_hop_keep == 0xff)
+ cc->next_hop_keep = cf->rr_client ? NH_IBGP : (cf->rs_client ? NH_ALL : NH_NO);
+
/* Different default based on rs_client */
if (!cc->missing_lladdr)
cc->missing_lladdr = cf->rs_client ? MLL_IGNORE : MLL_SELF;