Эх сурвалжийг харах

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: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Acked-by: Robert Shearman <rshearma@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David Ahern 8 жил өмнө
parent
commit
e944e97afc
1 өөрчлөгдсөн 2 нэмэгдсэн , 0 устгасан
  1. 2 0
      net/mpls/af_mpls.c

+ 2 - 0
net/mpls/af_mpls.c

@@ -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)