netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next] rtnl: fix the loop index update error in rtnl_dump_ifinfo()
@ 2016-11-19 15:28 Zhang Shengju
  2016-11-20  2:45 ` David Ahern
  2016-11-20  3:15 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Zhang Shengju @ 2016-11-19 15:28 UTC (permalink / raw)
  To: netdev; +Cc: dsa

If the link is filtered out, loop index should also be updated. If not,
loop index will not be correct.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
---
 net/core/rtnetlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index db313ec..f4b9350 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1606,7 +1606,7 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
 		head = &net->dev_index_head[h];
 		hlist_for_each_entry(dev, head, index_hlist) {
 			if (link_dump_filtered(dev, master_idx, kind_ops))
-				continue;
+				goto cont;
 			if (idx < s_idx)
 				goto cont;
 			err = rtnl_fill_ifinfo(skb, dev, RTM_NEWLINK,
-- 
1.8.3.1

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

* Re: [net-next] rtnl: fix the loop index update error in rtnl_dump_ifinfo()
  2016-11-19 15:28 [net-next] rtnl: fix the loop index update error in rtnl_dump_ifinfo() Zhang Shengju
@ 2016-11-20  2:45 ` David Ahern
  2016-11-20  3:15 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Ahern @ 2016-11-20  2:45 UTC (permalink / raw)
  To: Zhang Shengju, netdev

On 11/19/16 10:28 AM, Zhang Shengju wrote:
> If the link is filtered out, loop index should also be updated. If not,
> loop index will not be correct.
> 
> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> ---
>  net/core/rtnetlink.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index db313ec..f4b9350 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -1606,7 +1606,7 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
>  		head = &net->dev_index_head[h];
>  		hlist_for_each_entry(dev, head, index_hlist) {
>  			if (link_dump_filtered(dev, master_idx, kind_ops))
> -				continue;
> +				goto cont;
>  			if (idx < s_idx)
>  				goto cont;
>  			err = rtnl_fill_ifinfo(skb, dev, RTM_NEWLINK,
> 

Fixes: dc599f76c22b0 ("net: Add support for filtering link dump by master device and kind")

Acked-by: David Ahern <dsa@cumulusnetworks.com>

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

* Re: [net-next] rtnl: fix the loop index update error in rtnl_dump_ifinfo()
  2016-11-19 15:28 [net-next] rtnl: fix the loop index update error in rtnl_dump_ifinfo() Zhang Shengju
  2016-11-20  2:45 ` David Ahern
@ 2016-11-20  3:15 ` David Miller
  2016-11-21  5:12   ` 张胜举
  1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2016-11-20  3:15 UTC (permalink / raw)
  To: zhangshengju; +Cc: netdev, dsa

From: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Date: Sat, 19 Nov 2016 23:28:32 +0800

> If the link is filtered out, loop index should also be updated. If not,
> loop index will not be correct.
> 
> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>

Applied to 'net' and queued up for -stable.

Bug fixes should always be targetted at 'net' not 'net-next'.

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

* RE: [net-next] rtnl: fix the loop index update error in rtnl_dump_ifinfo()
  2016-11-20  3:15 ` David Miller
@ 2016-11-21  5:12   ` 张胜举
  0 siblings, 0 replies; 4+ messages in thread
From: 张胜举 @ 2016-11-21  5:12 UTC (permalink / raw)
  To: 'David Miller'; +Cc: netdev, dsa

> -----Original Message-----
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Sunday, November 20, 2016 11:15 AM
> To: zhangshengju@cmss.chinamobile.com
> Cc: netdev@vger.kernel.org; dsa@cumulusnetworks.com
> Subject: Re: [net-next] rtnl: fix the loop index update error in
> rtnl_dump_ifinfo()
> 
> From: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> Date: Sat, 19 Nov 2016 23:28:32 +0800
> 
> > If the link is filtered out, loop index should also be updated. If
> > not, loop index will not be correct.
> >
> > Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> 
> Applied to 'net' and queued up for -stable.
> 
> Bug fixes should always be targetted at 'net' not 'net-next'.

Thanks David, I will pay attention to this next time.

BRs,
Zhang Shengju

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

end of thread, other threads:[~2016-11-21  5:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-19 15:28 [net-next] rtnl: fix the loop index update error in rtnl_dump_ifinfo() Zhang Shengju
2016-11-20  2:45 ` David Ahern
2016-11-20  3:15 ` David Miller
2016-11-21  5:12   ` 张胜举

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