]> git.baikalelectronics.ru Git - kernel.git/commit
netlink: don't send unknown nsid
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Thu, 1 Jun 2017 08:00:07 +0000 (10:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Jun 2017 15:49:39 +0000 (11:49 -0400)
commitdbb7060a69fc17a67769af26113a1a06b9c54b12
tree26a869f3de07346f8b17219b4da34dbfedb8324f
parent971f0278732ca7e303b8aea731ec7c1f72f3a933
netlink: don't send unknown nsid

The NETLINK_F_LISTEN_ALL_NSID otion enables to listen all netns that have a
nsid assigned into the netns where the netlink socket is opened.
The nsid is sent as metadata to userland, but the existence of this nsid is
checked only for netns that are different from the socket netns. Thus, if
no nsid is assigned to the socket netns, NETNSA_NSID_NOT_ASSIGNED is
reported to the userland. This value is confusing and useless.
After this patch, only valid nsid are sent to userland.

Reported-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netlink/af_netlink.c