From: Stephen Worley Date: Fri, 22 Mar 2019 18:00:25 +0000 (-0400) Subject: zebra: Make nexthop group vrf VRF_DEFAULT X-Git-Tag: base_7.3~219^2~128 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=55eeb2ae7f56d7ecfa714d661d81e3ca0fb87ebc;p=matthieu%2Ffrr.git zebra: Make nexthop group vrf VRF_DEFAULT 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 --- diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 6753a22ecc..0d6b9b7ba2 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -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,