Skip to content

Commit

Permalink
net: mpls: Update lfib_nlmsg_size to skip deleted nexthops
Browse files Browse the repository at this point in the history
A recent commit skips nexthops in a route if the device has been
deleted. Update lfib_nlmsg_size accordingly.

Reported-by: Roopa Prabhu <[email protected]>
Signed-off-by: David Ahern <[email protected]>
Acked-by: Roopa Prabhu <[email protected]>
Acked-by: Robert Shearman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
David Ahern authored and davem330 committed Mar 29, 2017
1 parent d0281a5 commit e944e97
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/mpls/af_mpls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1880,6 +1880,8 @@ static inline size_t lfib_nlmsg_size(struct mpls_route *rt)
size_t nhsize = 0;

for_nexthops(rt) {
if (!rtnl_dereference(nh->nh_dev))
continue;
nhsize += nla_total_size(sizeof(struct rtnexthop));
/* RTA_VIA */
if (nh->nh_via_table != MPLS_NEIGH_TABLE_UNSPEC)
Expand Down

0 comments on commit e944e97

Please sign in to comment.