summaryrefslogtreecommitdiff
path: root/proto/bgp/bgp.h
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.h
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.h')
-rw-r--r--proto/bgp/bgp.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/proto/bgp/bgp.h b/proto/bgp/bgp.h
index 76b835fa..2b60f90f 100644
--- a/proto/bgp/bgp.h
+++ b/proto/bgp/bgp.h
@@ -134,8 +134,8 @@ struct bgp_channel_config {
const struct bgp_af_desc *desc;
ip_addr next_hop_addr; /* Local address for NEXT_HOP attribute */
- u8 next_hop_self; /* Always set next hop to local IP address */
- u8 next_hop_keep; /* Do not touch next hop attribute */
+ u8 next_hop_self; /* Always set next hop to local IP address (NH_*) */
+ u8 next_hop_keep; /* Do not modify next hop attribute (NH_*) */
u8 missing_lladdr; /* What we will do when we don' know link-local addr, see MLL_* */
u8 gw_mode; /* How we compute route gateway from next_hop attr, see GW_* */
u8 secondary; /* Accept also non-best routes (i.e. RA_ACCEPTED) */
@@ -151,12 +151,17 @@ struct bgp_channel_config {
struct rtable_config *igp_table_ip6; /* Table for recursive IPv6 next hop lookups */
};
-#define MLL_SELF 1
-#define MLL_DROP 2
-#define MLL_IGNORE 3
+#define NH_NO 0
+#define NH_ALL 1
+#define NH_IBGP 2
+#define NH_EBGP 3
-#define GW_DIRECT 1
-#define GW_RECURSIVE 2
+#define MLL_SELF 1
+#define MLL_DROP 2
+#define MLL_IGNORE 3
+
+#define GW_DIRECT 1
+#define GW_RECURSIVE 2
#define BGP_ADD_PATH_RX 1
#define BGP_ADD_PATH_TX 2