netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: mpls: Update lfib_nlmsg_size to skip deleted nexthops
@ 2017-03-28 22:19 David Ahern
  2017-03-28 23:23 ` Roopa Prabhu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Ahern @ 2017-03-28 22:19 UTC (permalink / raw)
  To: netdev; +Cc: roopa, David Ahern

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: mpls: Update lfib_nlmsg_size to skip deleted nexthops
  2017-03-28 22:19 [PATCH net-next] net: mpls: Update lfib_nlmsg_size to skip deleted nexthops David Ahern
@ 2017-03-28 23:23 ` Roopa Prabhu
  2017-03-29 10:20 ` Robert Shearman
  2017-03-29 17:43 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Roopa Prabhu @ 2017-03-28 23:23 UTC (permalink / raw)
  To: David Ahern; +Cc: netdev

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 <roopa@cumulusnetworks.com>
> Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
> ---
>
Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: mpls: Update lfib_nlmsg_size to skip deleted nexthops
  2017-03-28 22:19 [PATCH net-next] net: mpls: Update lfib_nlmsg_size to skip deleted nexthops David Ahern
  2017-03-28 23:23 ` Roopa Prabhu
@ 2017-03-29 10:20 ` Robert Shearman
  2017-03-29 17:43 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Robert Shearman @ 2017-03-29 10:20 UTC (permalink / raw)
  To: David Ahern, netdev; +Cc: roopa

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 <roopa@cumulusnetworks.com>
> Signed-off-by: David Ahern <dsa@cumulusnetworks.com>

Acked-by: Robert Shearman <rshearma@brocade.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: mpls: Update lfib_nlmsg_size to skip deleted nexthops
  2017-03-28 22:19 [PATCH net-next] net: mpls: Update lfib_nlmsg_size to skip deleted nexthops David Ahern
  2017-03-28 23:23 ` Roopa Prabhu
  2017-03-29 10:20 ` Robert Shearman
@ 2017-03-29 17:43 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-03-29 17:43 UTC (permalink / raw)
  To: dsa; +Cc: netdev, roopa

From: David Ahern <dsa@cumulusnetworks.com>
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 <roopa@cumulusnetworks.com>
> Signed-off-by: David Ahern <dsa@cumulusnetworks.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-29 17:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-28 22:19 [PATCH net-next] net: mpls: Update lfib_nlmsg_size to skip deleted nexthops David Ahern
2017-03-28 23:23 ` Roopa Prabhu
2017-03-29 10:20 ` Robert Shearman
2017-03-29 17:43 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).