summaryrefslogtreecommitdiff
path: root/zebra/rt_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/rt_netlink.c')
-rw-r--r--zebra/rt_netlink.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 0adbe2c27f..87ead20e86 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -1190,8 +1190,7 @@ netlink_route_multipath (int cmd, struct prefix *p, struct prefix *src_p,
{
int bytelen;
struct sockaddr_nl snl;
- struct nexthop *nexthop = NULL, *tnexthop;
- int recursing;
+ struct nexthop *nexthop = NULL;
unsigned int nexthop_num;
int discard;
int family = PREFIX_FAMILY(p);
@@ -1283,7 +1282,7 @@ netlink_route_multipath (int cmd, struct prefix *p, struct prefix *src_p,
if (discard)
{
if (cmd == RTM_NEWROUTE)
- for (ALL_NEXTHOPS_RO(re->nexthop, nexthop, tnexthop, recursing))
+ for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
{
/* We shouldn't encounter recursive nexthops on discard routes,
* but it is probably better to handle that case correctly anyway.
@@ -1297,7 +1296,7 @@ netlink_route_multipath (int cmd, struct prefix *p, struct prefix *src_p,
/* Count overall nexthops so we can decide whether to use singlepath
* or multipath case. */
nexthop_num = 0;
- for (ALL_NEXTHOPS_RO(re->nexthop, nexthop, tnexthop, recursing))
+ for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
{
if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
continue;
@@ -1313,7 +1312,7 @@ netlink_route_multipath (int cmd, struct prefix *p, struct prefix *src_p,
if (nexthop_num == 1 || multipath_num == 1)
{
nexthop_num = 0;
- for (ALL_NEXTHOPS_RO(re->nexthop, nexthop, tnexthop, recursing))
+ for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
{
if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
{
@@ -1354,7 +1353,7 @@ netlink_route_multipath (int cmd, struct prefix *p, struct prefix *src_p,
|| (cmd == RTM_DELROUTE
&& CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)))
{
- routedesc = recursing ? "recursive, 1 hop" : "single hop";
+ routedesc = nexthop->rparent ? "recursive, 1 hop" : "single hop";
_netlink_route_debug(cmd, p, nexthop, routedesc, family, zvrf);
_netlink_route_build_singlepath(routedesc, bytelen,
@@ -1384,7 +1383,7 @@ netlink_route_multipath (int cmd, struct prefix *p, struct prefix *src_p,
rtnh = RTA_DATA (rta);
nexthop_num = 0;
- for (ALL_NEXTHOPS_RO(re->nexthop, nexthop, tnexthop, recursing))
+ for (ALL_NEXTHOPS_RO(re->nexthop, nexthop))
{
if (nexthop_num >= multipath_num)
break;
@@ -1429,7 +1428,7 @@ netlink_route_multipath (int cmd, struct prefix *p, struct prefix *src_p,
|| (cmd == RTM_DELROUTE
&& CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)))
{
- routedesc = recursing ? "recursive, multihop" : "multihop";
+ routedesc = nexthop->rparent ? "recursive, multihop" : "multihop";
nexthop_num++;
_netlink_route_debug(cmd, p, nexthop,