zebra: rib->nexthop_num is double incremented
While reading linux kernel netlink messages, rib->nexthop_num is incremented
in the read loop as well as the underlying nexthop_add() function call. This
number should only be incremented in one spot. Removing the increment from
the read loop and allowing the underlying code to track this data as it is
already.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 33fbc08..cbcbe7c 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -765,7 +765,6 @@
if (len < (int) sizeof (*rtnh) || rtnh->rtnh_len > len)
break;
- rib->nexthop_num++;
index = rtnh->rtnh_ifindex;
gate = 0;
if (rtnh->rtnh_len > sizeof (*rtnh))
@@ -968,7 +967,6 @@
if (len < (int) sizeof (*rtnh) || rtnh->rtnh_len > len)
break;
- rib->nexthop_num++;
index = rtnh->rtnh_ifindex;
gate = 0;
if (rtnh->rtnh_len > sizeof (*rtnh))