]> git.proxmox.com Git - mirror_iproute2.git/commit - ip/ipnetns.c
ipmonitor: fix ip monitor can't work when NET_NS is not enabled
authorLiping Zhang <liping.zhang@spreadtrum.com>
Tue, 20 Sep 2016 09:09:02 +0000 (02:09 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 21 Sep 2016 23:32:44 +0000 (16:32 -0700)
commitc44003f7e7254ac972eaa1b22a686471ea4ce2d7
tree100a87c39b2617d63d7ce2864bd9a1cbd90c5ca5
parentbffb68b6c28a942d5341a912f5a11894f8bcf243
ipmonitor: fix ip monitor can't work when NET_NS is not enabled

In ip monitor, netns_map_init will check getnsid is supported or not.
But when /proc/self/ns/net does not exist, we just print out error
messages and exit. So user cannot use ip monitor anymore when
CONFIG_NET_NS is disabled:
  # ip monitor
  open("/proc/self/ns/net"): No such file or directory

If open "/proc/self/ns/net" failed, set have_rtnl_getnsid to false.

Fixes: d652ccbf8195 ("netns: allow to dump and monitor nsid")
Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
ip/ipnetns.c