Skip to content

Commit

Permalink
Merge pull request FRRouting#2704 from sworleys/Netlink-Nexthop-Hang
Browse files Browse the repository at this point in the history
zebra: Add check for nexthop loop to prevent hanging
  • Loading branch information
riw777 authored Jul 24, 2018
2 parents 72794b3 + 3c04071 commit 4dbd617
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions zebra/rt_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,9 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id,
route_entry_nexthop_ifindex_add(
re, index, nh_vrf_id);

if (rtnh->rtnh_len == 0)
break;

len -= NLMSG_ALIGN(rtnh->rtnh_len);
rtnh = RTNH_NEXT(rtnh);
}
Expand Down Expand Up @@ -700,6 +703,9 @@ static int netlink_route_change_read_multicast(struct nlmsghdr *h,
oif[oif_count] = rtnh->rtnh_ifindex;
oif_count++;

if (rtnh->rtnh_len == 0)
break;

len -= NLMSG_ALIGN(rtnh->rtnh_len);
rtnh = RTNH_NEXT(rtnh);
}
Expand Down

0 comments on commit 4dbd617

Please sign in to comment.