summaryrefslogtreecommitdiff
path: root/zebra/rt_netlink.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-02-15 11:16:22 -0500
committerStephen Worley <sworley@cumulusnetworks.com>2019-10-25 11:13:36 -0400
commiteecacedc3b9526b59ef690bce41f41158a137c9f (patch)
tree0655771318223c8800ee7ccf851da909cf2641af /zebra/rt_netlink.c
parent6b46851168ef37eaacba28a2a655e15ae5934cd0 (diff)
zebra: Remove re->nexthop_num from re
The nexthop_num is not a function of the re. It is owned by the nexthop group. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/rt_netlink.c')
-rw-r--r--zebra/rt_netlink.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 9bc919463b..b36fbb2008 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -609,7 +609,7 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id,
&src_p, &nh, table, metric, mtu, distance, tag);
} else {
/* This is a multipath route */
-
+ uint8_t nhop_num;
struct route_entry *re;
struct rtnexthop *rtnh =
(struct rtnexthop *)RTA_DATA(tb[RTA_MULTIPATH]);
@@ -624,7 +624,6 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id,
re->mtu = mtu;
re->vrf_id = vrf_id;
re->table = table;
- re->nexthop_num = 0;
re->uptime = monotime(NULL);
re->tag = tag;
re->ng = nexthop_group_new();
@@ -720,10 +719,10 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id,
rtnh = RTNH_NEXT(rtnh);
}
- zserv_nexthop_num_warn(__func__,
- (const struct prefix *)&p,
- re->nexthop_num);
- if (re->nexthop_num == 0) {
+ nhop_num = nexthop_group_nexthop_num(re->ng);
+ zserv_nexthop_num_warn(
+ __func__, (const struct prefix *)&p, nhop_num);
+ if (nhop_num == 0) {
nexthop_group_delete(&re->ng);
XFREE(MTYPE_RE, re);
} else