diff options
author | Mark Stapp <mjs@voltanet.io> | 2019-06-11 19:47:15 +0200 |
---|---|---|
committer | Mark Stapp <mjs@voltanet.io> | 2019-06-12 17:37:05 +0200 |
commit | e65fe398f6ba1a47a04793f7e25d6557ee705b7f (patch) | |
tree | d3d4ab2b74687c150852bc2d3c8dceebbdc8d91c /bgpd/bgp_mplsvpn.c | |
parent | Merge pull request #4498 from ak503/ldpd (diff) | |
download | frr-e65fe398f6ba1a47a04793f7e25d6557ee705b7f.tar.xz frr-e65fe398f6ba1a47a04793f7e25d6557ee705b7f.zip |
bgpd: auto router-id should not change configured vpn RD/RT
A router-id change that isn't explicitly configured (a change
from zebra, for example) should not replace a configured vpn
RD/RT.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'bgpd/bgp_mplsvpn.c')
-rw-r--r-- | bgpd/bgp_mplsvpn.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index 6eddd0e1e..355bc9332 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -1488,7 +1488,8 @@ static void vpn_policy_routemap_update(struct bgp *bgp, const char *rmap_name) /* This API is used during router-id change, reflect VPNs * auto RD and RT values and readvertise routes to VPN table. */ -void vpn_handle_router_id_update(struct bgp *bgp, bool withdraw) +void vpn_handle_router_id_update(struct bgp *bgp, bool withdraw, + bool is_config) { afi_t afi; int debug; @@ -1536,6 +1537,20 @@ void vpn_handle_router_id_update(struct bgp *bgp, bool withdraw) } } else { + /* + * Router-id changes that are not explicit config + * changes should not replace configured RD/RT. + */ + if (!is_config) { + if (CHECK_FLAG(bgp->vpn_policy[afi].flags, + BGP_VPN_POLICY_TOVPN_RD_SET)) { + if (debug) + zlog_debug("%s: auto router-id change skipped", + __func__); + goto postchange; + } + } + /* New router-id derive auto RD and RT and export * to VPN */ @@ -1565,6 +1580,8 @@ void vpn_handle_router_id_update(struct bgp *bgp, bool withdraw) = ecommunity_dup(ecom); } + +postchange: /* Update routes to VPN */ vpn_leak_postchange(BGP_VPN_POLICY_DIR_TOVPN, afi, bgp_get_default(), |