From 1cab2b4a7cffb7ad604dcbd200267733ef079973 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Sun, 16 Dec 2018 23:44:24 +0100 Subject: 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. --- proto/bgp/bgp.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'proto/bgp/bgp.h') 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 -- cgit v1.2.3