summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_bmp.c5
-rw-r--r--bgpd/bgp_vty.c8
-rw-r--r--bgpd/bgpd.c9
3 files changed, 18 insertions, 4 deletions
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c
index a18394c76a..9b42c6039e 100644
--- a/bgpd/bgp_bmp.c
+++ b/bgpd/bgp_bmp.c
@@ -2433,8 +2433,11 @@ DEFPY(bmp_connect,
}
ba = bmp_active_get(bt, hostname, port);
- if (srcif)
+ if (srcif) {
+ if (ba->ifsrc)
+ XFREE(MTYPE_TMP, ba->ifsrc);
ba->ifsrc = XSTRDUP(MTYPE_TMP, srcif);
+ }
if (min_retry_str)
ba->minretry = min_retry;
if (max_retry_str)
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 2ae63d37ac..27f50a8854 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -9708,6 +9708,8 @@ DEFPY (af_rd_vpn_export,
bgp_get_default(), bgp);
if (yes) {
+ if (bgp->vpn_policy[afi].tovpn_rd_pretty)
+ XFREE(MTYPE_BGP_NAME, bgp->vpn_policy[afi].tovpn_rd_pretty);
bgp->vpn_policy[afi].tovpn_rd_pretty = XSTRDUP(MTYPE_BGP_NAME,
rd_str);
bgp->vpn_policy[afi].tovpn_rd = prd;
@@ -18632,7 +18634,11 @@ static void bgp_config_write_peer_global(struct vty *vty, struct bgp *bgp,
/* enforce-first-as */
if (CHECK_FLAG(bgp->flags, BGP_FLAG_ENFORCE_FIRST_AS)) {
- if (!peergroup_flag_check(peer, PEER_FLAG_ENFORCE_FIRST_AS))
+ /* The `no` form is printed because by default this enforcing
+ * is enabled, thus we need to print it inverted.
+ * See peer_new().
+ */
+ if (peergroup_flag_check(peer, PEER_FLAG_ENFORCE_FIRST_AS))
vty_out(vty, " no neighbor %s enforce-first-as\n", addr);
} else {
if (peergroup_flag_check(peer, PEER_FLAG_ENFORCE_FIRST_AS))
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index 08d2fcebed..df201f24cb 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -1566,8 +1566,13 @@ struct peer *peer_new(struct bgp *bgp)
SET_FLAG(peer->sflags, PEER_STATUS_CAPABILITY_OPEN);
- if (CHECK_FLAG(bgp->flags, BGP_FLAG_ENFORCE_FIRST_AS))
- peer_flag_set(peer, PEER_FLAG_ENFORCE_FIRST_AS);
+ /* By default this is enabled, thus we need to mark it as
+ * inverted in order to display correctly in the configuration.
+ */
+ if (CHECK_FLAG(bgp->flags, BGP_FLAG_ENFORCE_FIRST_AS)) {
+ SET_FLAG(peer->flags_invert, PEER_FLAG_ENFORCE_FIRST_AS);
+ SET_FLAG(peer->flags, PEER_FLAG_ENFORCE_FIRST_AS);
+ }
if (CHECK_FLAG(bgp->flags, BGP_FLAG_SOFT_VERSION_CAPABILITY))
peer_flag_set(peer, PEER_FLAG_CAPABILITY_SOFT_VERSION);