]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Make nexthop group vrf VRF_DEFAULT
authorStephen Worley <sworley@cumulusnetworks.com>
Fri, 22 Mar 2019 18:00:25 +0000 (14:00 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Fri, 25 Oct 2019 15:13:38 +0000 (11:13 -0400)
Nexthop groups can have nexthops in different vrf's. So,
let's make the group vrf_id just be VRF_DEFAULT for hash
lookup purposes.

Set vrf_id to be VRF_DEFAULT for every message. If its a new
nextop, set the vrf to be the appropriate thing, otherwise
its a group and can just be left as default.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
zebra/rt_netlink.c

index 6753a22eccef5cce7a1b1611d89541b929086a84..0d6b9b7ba21ba9fbde70c9e2d9109ae4e7981f1e 100644 (file)
@@ -2247,6 +2247,7 @@ int netlink_nexthop_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
        uint32_t id;
        unsigned char family;
        afi_t afi = AFI_UNSPEC;
+       vrf_id_t vrf_id = VRF_DEFAULT;
        struct interface *ifp = NULL;
        struct nhmsg *nhm = NULL;
        /* struct for nexthop group abstraction  */
@@ -2332,7 +2333,7 @@ int netlink_nexthop_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
                                if (nhm->nh_flags & RTNH_F_ONLINK)
                                        SET_FLAG(nh->flags,
                                                 NEXTHOP_FLAG_ONLINK);
-
+                               vrf_id = nh->vrf_id;
                                nexthop_group_add_sorted(nhg, nh);
                        } else {
                                flog_warn(
@@ -2363,8 +2364,8 @@ int netlink_nexthop_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
 
                } else {
                        /* This is a new nexthop group */
-                       nhe = zebra_nhg_find(nhg, nhg->nexthop->vrf_id, afi, id,
-                                            nhg_depends, dep_count);
+                       nhe = zebra_nhg_find(nhg, vrf_id, afi, id, nhg_depends,
+                                            dep_count);
                        if (!nhe) {
                                flog_err(
                                        EC_ZEBRA_TABLE_LOOKUP_FAILED,