[PATCH net-next] net: mpls: Update lfib_nlmsg_size to skip deleted nexthops

Subsystems: networking [general], the rest

STALE3411d

4 messages, 4 authors, 2017-03-29 · open the first message on its own page

[PATCH net-next] net: mpls: Update lfib_nlmsg_size to skip deleted nexthops

From: David Ahern <hidden>
Date: 2017-03-28 22:20:29

A recent commit skips nexthops in a route if the device has been
deleted. Update lfib_nlmsg_size accordingly.

Reported-by: Roopa Prabhu <redacted>
Signed-off-by: David Ahern <redacted>
---
 net/mpls/af_mpls.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c
index 74755920c689..0d08229c98c9 100644
--- a/net/mpls/af_mpls.c
+++ b/net/mpls/af_mpls.c
@@ -1876,6 +1876,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)
-- 
2.1.4

Re: [PATCH net-next] net: mpls: Update lfib_nlmsg_size to skip deleted nexthops

From: Roopa Prabhu <hidden>
Date: 2017-03-28 23:23:20

On 3/28/17, 3:19 PM, David Ahern wrote:
A recent commit skips nexthops in a route if the device has been
deleted. Update lfib_nlmsg_size accordingly.

Reported-by: Roopa Prabhu <redacted>
Signed-off-by: David Ahern <redacted>
---
Acked-by: Roopa Prabhu <redacted>

Re: [PATCH net-next] net: mpls: Update lfib_nlmsg_size to skip deleted nexthops

From: Robert Shearman <hidden>
Date: 2017-03-29 10:20:21

On 28/03/17 23:19, David Ahern wrote:
A recent commit skips nexthops in a route if the device has been
deleted. Update lfib_nlmsg_size accordingly.

Reported-by: Roopa Prabhu <redacted>
Signed-off-by: David Ahern <redacted>
Acked-by: Robert Shearman <redacted>

Re: [PATCH net-next] net: mpls: Update lfib_nlmsg_size to skip deleted nexthops

From: David Miller <davem@davemloft.net>
Date: 2017-03-29 17:43:04

From: David Ahern <redacted>
Date: Tue, 28 Mar 2017 15:19:49 -0700
A recent commit skips nexthops in a route if the device has been
deleted. Update lfib_nlmsg_size accordingly.

Reported-by: Roopa Prabhu <redacted>
Signed-off-by: David Ahern <redacted>
Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help