From: Philippe Guibert Date: Tue, 9 Oct 2018 14:05:04 +0000 (+0200) Subject: bgpd: vpn route-map config should be kept, except if vrf list is on X-Git-Tag: frr-7.1-dev~221^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=8a066a70c3e9f7003cb4cc4320b7ad2e8d417eed;p=matthieu%2Ffrr.git bgpd: vpn route-map config should be kept, except if vrf list is on When executing vpn route-map config for importation, the running-config records vrf import route-map instead. Actually, this is a problem when restarting configuring when using vpn route-map. The choice is done to move to vrf format, when at least one import list is created for vrfs. Signed-off-by: Philippe Guibert --- diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index e705a714e9..026cfbe2c5 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -12282,11 +12282,16 @@ void bgp_vpn_policy_config_write_afi(struct vty *vty, struct bgp *bgp, { int indent = 2; - if (bgp->vpn_policy[afi].rmap_name[BGP_VPN_POLICY_DIR_FROMVPN]) - vty_out(vty, "%*simport vrf route-map %s\n", indent, "", - bgp->vpn_policy[afi] + if (bgp->vpn_policy[afi].rmap_name[BGP_VPN_POLICY_DIR_FROMVPN]) { + if (listcount(bgp->vpn_policy[afi].import_vrf)) + vty_out(vty, "%*simport vrf route-map %s\n", indent, "", + bgp->vpn_policy[afi] .rmap_name[BGP_VPN_POLICY_DIR_FROMVPN]); - + else + vty_out(vty, "%*sroute-map vpn import %s\n", indent, "", + bgp->vpn_policy[afi] + .rmap_name[BGP_VPN_POLICY_DIR_FROMVPN]); + } if (CHECK_FLAG(bgp->af_flags[afi][SAFI_UNICAST], BGP_CONFIG_VRF_TO_VRF_IMPORT) || CHECK_FLAG(bgp->af_flags[afi][SAFI_UNICAST],