]> www.infradead.org Git - users/dwmw2/linux.git/commit
net/ipv6: don't return positive numbers when nothing was dumped
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 22 Jan 2019 22:47:19 +0000 (14:47 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Feb 2019 16:27:35 +0000 (17:27 +0100)
commitc42b60e2305008cc5eceecbc80322302283a3e74
tree98f6fce0b41b797f5f62aa16101cb8e2df83aa7c
parent5195acd38ae48b7b5c186f522cd4351441297859
net/ipv6: don't return positive numbers when nothing was dumped

[ Upstream commit 1518039f6b5ac794313c24c76f85cead0cd60f6c ]

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>
Reviewed-by: David Ahern <dsahern@gmail.com>
Tested-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv6/addrconf.c