]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: fix import vrf route-map issues
authorDon Slice <dslice@cumulusnetworks.com>
Tue, 10 Apr 2018 15:00:18 +0000 (15:00 +0000)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 25 Apr 2018 16:39:17 +0000 (12:39 -0400)
Prior to this fix, the import vrf route-map command only worked
if the route-map existed prior to the command.  Additionally, if
the import vrf route-map command was issued without an existing
route-map, the imported prefixes were not removed.  This fix
resolves both of thes mis-behaviors. bgp-smoke run with same
failures as base.

Ticket: CM-20459
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: CCR-7358
bgpd/bgp_vty.c

index 4c4178495fbe35942b562feba7df8d36db442ecf..49b39d5ec2fc2a4552e681634d18a4b013eb6d5e 100644 (file)
@@ -6551,6 +6551,8 @@ DEFPY (af_route_map_vpn_imexport,
                                        MTYPE_ROUTE_MAP_NAME, rmap_str);
                                bgp->vpn_policy[afi].rmap[dir] =
                                        route_map_lookup_by_name(rmap_str);
+                               if (!bgp->vpn_policy[afi].rmap[dir])
+                                       return CMD_SUCCESS;
                        } else {
                                if (bgp->vpn_policy[afi].rmap_name[dir])
                                        XFREE(MTYPE_ROUTE_MAP_NAME,
@@ -6629,6 +6631,8 @@ DEFPY(af_import_vrf_route_map, af_import_vrf_route_map_cmd,
                                XSTRDUP(MTYPE_ROUTE_MAP_NAME, rmap_str);
                        bgp->vpn_policy[afi].rmap[dir] =
                                route_map_lookup_by_name(rmap_str);
+                       if (!bgp->vpn_policy[afi].rmap[dir])
+                               return CMD_SUCCESS;
                } else {
                        if (bgp->vpn_policy[afi].rmap_name[dir])
                                XFREE(MTYPE_ROUTE_MAP_NAME,