summaryrefslogtreecommitdiff
path: root/bgpd/bgp_vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_vty.c')
-rw-r--r--bgpd/bgp_vty.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 046b18f224..98021f7ef4 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -122,6 +122,12 @@ FRR_CFG_DEFAULT_BOOL(BGP_ENFORCE_FIRST_AS,
{ .val_bool = false, .match_version = "< 9.1", },
{ .val_bool = true },
);
+FRR_CFG_DEFAULT_BOOL(BGP_RR_ALLOW_OUTBOUND_POLICY,
+ { .val_bool = false },
+);
+FRR_CFG_DEFAULT_BOOL(BGP_COMPARE_AIGP,
+ { .val_bool = false },
+);
DEFINE_HOOK(bgp_inst_config_write,
(struct bgp *bgp, struct vty *vty),
@@ -622,6 +628,10 @@ int bgp_get_vty(struct bgp **bgp, as_t *as, const char *name,
BGP_FLAG_DYNAMIC_CAPABILITY);
if (DFLT_BGP_ENFORCE_FIRST_AS)
SET_FLAG((*bgp)->flags, BGP_FLAG_ENFORCE_FIRST_AS);
+ if (DFLT_BGP_RR_ALLOW_OUTBOUND_POLICY)
+ SET_FLAG((*bgp)->flags, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY);
+ if (DFLT_BGP_COMPARE_AIGP)
+ SET_FLAG((*bgp)->flags, BGP_FLAG_COMPARE_AIGP);
ret = BGP_SUCCESS;
}
@@ -16681,9 +16691,9 @@ static int bgp_show_route_leak_vty(struct vty *vty, const char *name,
json_object_new_string(vname));
json_object_object_add(json, "exportToVrfs",
json_export_vrfs);
- json_object_string_addf(
- json, "routeDistinguisher", "%s",
- bgp->vpn_policy[afi].tovpn_rd_pretty);
+ json_object_string_addf(json, "routeDistinguisher",
+ BGP_RD_AS_FORMAT(bgp->asnotation),
+ &bgp->vpn_policy[afi].tovpn_rd);
dir = BGP_VPN_POLICY_DIR_TOVPN;
if (bgp->vpn_policy[afi].rtlist[dir]) {
ecom_str = ecommunity_ecom2str(
@@ -19780,14 +19790,19 @@ int bgp_config_write(struct vty *vty)
}
}
- if (CHECK_FLAG(bgp->flags, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY)) {
- vty_out(vty,
- " bgp route-reflector allow-outbound-policy\n");
- }
+ if (!!CHECK_FLAG(bgp->flags, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY) !=
+ SAVE_BGP_RR_ALLOW_OUTBOUND_POLICY)
+ vty_out(vty, " %sbgp route-reflector allow-outbound-policy\n",
+ CHECK_FLAG(bgp->flags, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY) ? ""
+ : "no ");
+
if (CHECK_FLAG(bgp->flags, BGP_FLAG_COMPARE_ROUTER_ID))
vty_out(vty, " bgp bestpath compare-routerid\n");
- if (CHECK_FLAG(bgp->flags, BGP_FLAG_COMPARE_AIGP))
- vty_out(vty, " bgp bestpath aigp\n");
+
+ if (!!CHECK_FLAG(bgp->flags, BGP_FLAG_COMPARE_AIGP) != SAVE_BGP_COMPARE_AIGP)
+ vty_out(vty, " %sbgp bestpath aigp\n",
+ CHECK_FLAG(bgp->flags, BGP_FLAG_COMPARE_AIGP) ? "" : "no ");
+
if (CHECK_FLAG(bgp->flags, BGP_FLAG_MED_CONFED)
|| CHECK_FLAG(bgp->flags, BGP_FLAG_MED_MISSING_AS_WORST)) {
vty_out(vty, " bgp bestpath med");