diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-02-13 16:06:48 -0500 |
|---|---|---|
| committer | Stephen Worley <sworley@cumulusnetworks.com> | 2019-10-25 11:13:36 -0400 |
| commit | 6b46851168ef37eaacba28a2a655e15ae5934cd0 (patch) | |
| tree | 8e77f5c84e8fc6d9f564a6b33fb2008e6bf5f234 /zebra/rt_netlink.c | |
| parent | 79580b5ac4ba584baf2a50825949abff18c77f91 (diff) | |
zebra: Replace nexthop_group with pointer in route entry
In the route_entry we are keeping a non pointer based
nexthop group, switch the code to use a pointer for all
operations here and ensure we create and delete the memory.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/rt_netlink.c')
| -rw-r--r-- | zebra/rt_netlink.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 43e44cad16..9bc919463b 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -627,6 +627,7 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id, re->nexthop_num = 0; re->uptime = monotime(NULL); re->tag = tag; + re->ng = nexthop_group_new(); for (;;) { struct nexthop *nh = NULL; @@ -722,9 +723,10 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id, zserv_nexthop_num_warn(__func__, (const struct prefix *)&p, re->nexthop_num); - if (re->nexthop_num == 0) + if (re->nexthop_num == 0) { + nexthop_group_delete(&re->ng); XFREE(MTYPE_RE, re); - else + } else rib_add_multipath(afi, SAFI_UNICAST, &p, &src_p, re); } |
