]> git.puffer.fish Git - mirror/frr.git/commitdiff
bpgd: add missing sid setting in address-family 9456/head
authorRyoga Saito <contact@proelbtn.com>
Thu, 19 Aug 2021 05:41:13 +0000 (05:41 +0000)
committerRyoga Saito <contact@proelbtn.com>
Thu, 19 Aug 2021 05:59:32 +0000 (05:59 +0000)
current bgpd doesn't write sid setting, resulting to fail to save
configuration correctly.

Signed-off-by: Ryoga Saito <contact@proelbtn.com>
bgpd/bgp_vty.c

index 178b5d5e66f75feda10422c2ba1e01ebb9895c12..27f147a4aaf9b0040dafae7414128f1740218a09 100644 (file)
@@ -15982,6 +15982,7 @@ static void bgp_vpn_policy_config_write_afi(struct vty *vty, struct bgp *bgp,
                                            afi_t afi)
 {
        int indent = 2;
+       uint32_t tovpn_sid_index = 0;
 
        if (bgp->vpn_policy[afi].rmap_name[BGP_VPN_POLICY_DIR_FROMVPN]) {
                if (CHECK_FLAG(bgp->af_flags[afi][SAFI_UNICAST],
@@ -16011,6 +16012,16 @@ static void bgp_vpn_policy_config_write_afi(struct vty *vty, struct bgp *bgp,
                                bgp->vpn_policy[afi].tovpn_label);
                }
        }
+
+       tovpn_sid_index = bgp->vpn_policy[afi].tovpn_sid_index;
+       if (CHECK_FLAG(bgp->vpn_policy[afi].flags,
+                      BGP_VPN_POLICY_TOVPN_SID_AUTO)) {
+               vty_out(vty, "%*ssid vpn export %s\n", indent, "", "auto");
+       } else if (tovpn_sid_index != 0) {
+               vty_out(vty, "%*ssid vpn export %d\n", indent, "",
+                       tovpn_sid_index);
+       }
+
        if (CHECK_FLAG(bgp->vpn_policy[afi].flags,
                       BGP_VPN_POLICY_TOVPN_RD_SET)) {
                char buf[RD_ADDRSTRLEN];