* [PATCH net v2] net/ipv6: don't return positive numbers when nothing was dumped
@ 2019-01-22 22:47 Jakub Kicinski
2019-01-22 22:53 ` David Ahern
2019-01-23 1:25 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2019-01-22 22:47 UTC (permalink / raw)
To: davem; +Cc: dsahern, netdev, oss-drivers, Jakub Kicinski
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;
}
--
2.19.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net v2] net/ipv6: don't return positive numbers when nothing was dumped
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
2019-01-23 1:25 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Ahern @ 2019-01-22 22:53 UTC (permalink / raw)
To: Jakub Kicinski, davem; +Cc: netdev, oss-drivers
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.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net v2] net/ipv6: don't return positive numbers when nothing was dumped
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
@ 2019-01-23 1:25 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-01-23 1:25 UTC (permalink / raw)
To: jakub.kicinski; +Cc: dsahern, netdev, oss-drivers
From: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Tue, 22 Jan 2019 14:47:19 -0800
> 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>
Applied, and since the RTM_GETADDR regression fix was backports I'll have
to -stable this as well.
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-01-23 1:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2019-01-23 1:25 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox