]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: some v4 attributes were being written 2 times
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 30 Jan 2019 01:17:36 +0000 (20:17 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 30 Jan 2019 01:41:18 +0000 (20:41 -0500)
When the nexthop->type is NEXTHOP_TYPE_IPV4_IFINDEX we
were writing the RTA_PREFSRC 2 times for the build_singlepath
and build_multipath functions.

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

index b6ec7352ab8575bb71623456043899f11e94af64..a70d6866871acfb5630532083ed86ec852018bad 100644 (file)
@@ -1133,8 +1133,7 @@ static void _netlink_route_build_singlepath(const char *routedesc, int bytelen,
        if (nexthop->type != NEXTHOP_TYPE_BLACKHOLE)
                addattr32(nlmsg, req_size, RTA_OIF, nexthop->ifindex);
 
-       if (nexthop->type == NEXTHOP_TYPE_IFINDEX
-           || nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX) {
+       if (nexthop->type == NEXTHOP_TYPE_IFINDEX) {
                if (cmd == RTM_NEWROUTE) {
                        if (nexthop->rmap_src.ipv4.s_addr)
                                addattr_l(nlmsg, req_size, RTA_PREFSRC,
@@ -1321,8 +1320,7 @@ static void _netlink_route_build_multipath(const char *routedesc, int bytelen,
                rtnh->rtnh_ifindex = nexthop->ifindex;
 
        /* ifindex */
-       if (nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX
-           || nexthop->type == NEXTHOP_TYPE_IFINDEX) {
+       if (nexthop->type == NEXTHOP_TYPE_IFINDEX) {
                if (nexthop->rmap_src.ipv4.s_addr)
                        *src = &nexthop->rmap_src;
                else if (nexthop->src.ipv4.s_addr)