From 8f79e6b93e32a4eb7e4dda9bd4a9d04400b79d45 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Mon, 10 Oct 2022 05:06:19 +0200 Subject: BGP: Add option 'next hop prefer global' Add BGP channel option 'next hop prefer global' that modifies BGP recursive next hop resolution to use global next hop IPv6 address instead of link-local next hop IPv6 address for immediate next hop of received routes. --- proto/bgp/bgp.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'proto/bgp/bgp.c') diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index e1e0d796..ad78d5e5 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -2037,6 +2037,10 @@ bgp_postconfig(struct proto_config *CF) if (!cc->gw_mode) cc->gw_mode = cf->multihop ? GW_RECURSIVE : GW_DIRECT; + /* Different default for next_hop_prefer */ + if (!cc->next_hop_prefer) + cc->next_hop_prefer = (cc->gw_mode == GW_DIRECT) ? NHP_GLOBAL : NHP_LOCAL; + /* Defaults based on proto config */ if (cc->gr_able == 0xff) cc->gr_able = (cf->gr_mode == BGP_GR_ABLE); @@ -2167,6 +2171,7 @@ bgp_channel_reconfigure(struct channel *C, struct channel_config *CC, int *impor return 0; if ((new->gw_mode != old->gw_mode) || + (new->next_hop_prefer != old->next_hop_prefer) || (new->aigp != old->aigp) || (new->cost != old->cost)) { -- cgit v1.2.3