Commit e944e97a authored by David Ahern's avatar David Ahern Committed by David S. Miller

net: mpls: Update lfib_nlmsg_size to skip deleted nexthops

A recent commit skips nexthops in a route if the device has been
deleted. Update lfib_nlmsg_size accordingly.
Reported-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
Acked-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
Acked-by: default avatarRobert Shearman <rshearma@brocade.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d0281a56
...@@ -1880,6 +1880,8 @@ static inline size_t lfib_nlmsg_size(struct mpls_route *rt) ...@@ -1880,6 +1880,8 @@ static inline size_t lfib_nlmsg_size(struct mpls_route *rt)
size_t nhsize = 0; size_t nhsize = 0;
for_nexthops(rt) { for_nexthops(rt) {
if (!rtnl_dereference(nh->nh_dev))
continue;
nhsize += nla_total_size(sizeof(struct rtnexthop)); nhsize += nla_total_size(sizeof(struct rtnexthop));
/* RTA_VIA */ /* RTA_VIA */
if (nh->nh_via_table != MPLS_NEIGH_TABLE_UNSPEC) if (nh->nh_via_table != MPLS_NEIGH_TABLE_UNSPEC)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment