]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Dissallow v6 routes from setting a v4 nexthop
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 20 Oct 2018 00:43:47 +0000 (20:43 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 20 Oct 2018 00:43:47 +0000 (20:43 -0400)
Do not allow a v6 route to set a v4 nexthop via a routemap.
As that this will crash bgp.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_routemap.c

index 1b2c1306f72447f860869ae02b5fefb6039c9c87..ca0291d0a1884ff7a932e42a31366a7b3174e61c 100644 (file)
@@ -1406,6 +1406,9 @@ static route_map_result_t route_set_ip_nexthop(void *rule,
        if (type != RMAP_BGP)
                return RMAP_OKAY;
 
+       if (prefix->family == AF_INET6)
+               return RMAP_OKAY;
+
        path = object;
        peer = path->peer;