]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: VRF ID should be null if a nexthop group
authorStephen Worley <sworley@cumulusnetworks.com>
Thu, 11 Apr 2019 16:00:51 +0000 (12:00 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Fri, 25 Oct 2019 15:13:39 +0000 (11:13 -0400)
A nexthop group should not have a VRF ID. Only individual
nexthops need to be using a VRF. Fixed this both kernel and
proto side.

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

index d2d9060b84c90ecdd85b002947191945b09f7e36..db8e28cea0c6a4c9e5abf677ead82b5fcd43f6db 100644 (file)
@@ -2298,7 +2298,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;
+       vrf_id_t vrf_id = 0;
        struct interface *ifp = NULL;
        struct nhmsg *nhm = NULL;
        /* struct for nexthop group abstraction  */
index 898076b017210d1b5191e53070858d9a4fe80b9e..96e5816da316810e91e365be6648021ea15bcb01 100644 (file)
@@ -2641,6 +2641,8 @@ int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p,
        struct nhg_connected_head nhg_depends = {0};
        /* Default to route afi */
        afi_t nhg_afi = afi;
+       /* Default to route vrf id */
+       vrf_id_t nhg_vrf_id = re->vrf_id;
        int ret = 0;
 
        if (!re)
@@ -2680,10 +2682,11 @@ int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p,
 
                /* change the afi for group */
                nhg_afi = AFI_UNSPEC;
+               nhg_vrf_id = 0;
        }
 
        // TODO: Add proto type here
-       nhe = zebra_nhg_find(re->ng, re->vrf_id, nhg_afi, re->nhe_id,
+       nhe = zebra_nhg_find(re->ng, nhg_vrf_id, nhg_afi, re->nhe_id,
                             &nhg_depends, false);
 
        if (nhe) {