netlink: ensure to loop over all netns in genlmsg_multicast_allns()
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Tue, 6 Feb 2018 13:48:32 +0000 (14:48 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 31 May 2018 23:30:13 +0000 (00:30 +0100)
commitab38ffccdf4e0b86b8e6be1ff8c7ce53df74c4ec
treebdf3aa2ed04b5e5490d3a8db51c5291d3daabba1
parentbbac54a340725967fc76de730f384503bfcb835e
netlink: ensure to loop over all netns in genlmsg_multicast_allns()

commit cb9f7a9a5c96a773bbc9c70660dc600cfff82f82 upstream.

Nowadays, nlmsg_multicast() returns only 0 or -ESRCH but this was not the
case when commit 134e63756d5f was pushed.
However, there was no reason to stop the loop if a netns does not have
listeners.
Returns -ESRCH only if there was no listeners in all netns.

To avoid having the same problem in the future, I didn't take the
assumption that nlmsg_multicast() returns only 0 or -ESRCH.

Fixes: 134e63756d5f ("genetlink: make netns aware")
CC: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.2: s/portid/pid/]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/netlink/genetlink.c