Netdev List
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Jakub Kicinski <jakub.kicinski@netronome.com>, davem@davemloft.net
Cc: netdev@vger.kernel.org, oss-drivers@netronome.com
Subject: Re: [PATCH net v2] net/ipv6: don't return positive numbers when nothing was dumped
Date: Tue, 22 Jan 2019 15:53:25 -0700	[thread overview]
Message-ID: <b98ba1ff-a8d4-65f2-bbfe-5cbb295438c3@gmail.com> (raw)
In-Reply-To: <20190122224719.7509-1-jakub.kicinski@netronome.com>

On 1/22/19 3:47 PM, Jakub Kicinski wrote:
> in6_dump_addrs() returns a positive 1 if there was nothing to dump.
> This return value can not be passed as return from inet6_dump_addr()
> as is, because it will confuse rtnetlink, resulting in NLMSG_DONE
> never getting set:
> 
> $ ip addr list dev lo
> EOF on netlink
> Dump terminated
> 
> v2: flip condition to avoid a new goto (DaveA)
> 
> Fixes: 7c1e8a3817c5 ("netlink: fixup regression in RTM_GETADDR")
> Reported-by: Brendan Galloway <brendan.galloway@netronome.com>
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> ---
>  net/ipv6/addrconf.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index 57198b3c86da..015e5ccbe306 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -5155,6 +5155,8 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb,
>  			if (idev) {
>  				err = in6_dump_addrs(idev, skb, cb, s_ip_idx,
>  						     &fillargs);
> +				if (err > 0)
> +					err = 0;
>  			}
>  			goto put_tgt_net;
>  		}
> 

Reviewed-by: David Ahern <dsahern@gmail.com>
Tested-by: David Ahern <dsahern@gmail.com>

Thanks, Jakub.

  reply	other threads:[~2019-01-22 22:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22 22:47 [PATCH net v2] net/ipv6: don't return positive numbers when nothing was dumped Jakub Kicinski
2019-01-22 22:53 ` David Ahern [this message]
2019-01-23  1:25 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b98ba1ff-a8d4-65f2-bbfe-5cbb295438c3@gmail.com \
    --to=dsahern@gmail.com \
    --cc=davem@davemloft.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox