]> git.baikalelectronics.ru Git - kernel.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)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Jan 2019 01:24:18 +0000 (17:24 -0800)
commitd3bd3194a2ce2785fe7ad89cfb9248b215e1fcbb
tree1ade65e4d0b8b45670a7de1b0d045b6e7b3c509b
parentf44dc4c91ff8517bc088214f73d02acb0b7ece07
net/ipv6: don't return positive numbers when nothing was dumped

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: 0de40698ac15 ("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>
net/ipv6/addrconf.c