aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/utils
diff options
context:
space:
mode:
authorYousong Zhou <yszhou4tech@gmail.com>2017-03-17 17:49:29 +0800
committerYousong Zhou <yszhou4tech@gmail.com>2017-03-19 12:41:13 +0800
commit312b9dcd655b5469a08aed119d0936ad96cf5fdb (patch)
tree8cd090dfee69b7e6c1faff1c56c4bbd6a838e823 /package/network/utils
parent0694d08c84fd528e02c91c01a9c1c32639d85cc7 (diff)
downloadupstream-312b9dcd655b5469a08aed119d0936ad96cf5fdb.tar.gz
upstream-312b9dcd655b5469a08aed119d0936ad96cf5fdb.tar.bz2
upstream-312b9dcd655b5469a08aed119d0936ad96cf5fdb.zip
iproute2: fix ip monitor can't work when NET_NS is not enabled
The bug appeared in v4.1.0 and was fixed since v4.8.0 Fixes FS#620 Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Diffstat (limited to 'package/network/utils')
-rw-r--r--package/network/utils/iproute2/Makefile2
-rw-r--r--package/network/utils/iproute2/patches/960-ipmonitor-fix-ip-monitor-can-t-work-when-NET_NS-is-n.patch40
2 files changed, 41 insertions, 1 deletions
diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile
index af8e64c242..1c1ee3f24e 100644
--- a/package/network/utils/iproute2/Makefile
+++ b/package/network/utils/iproute2/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=iproute2
PKG_VERSION:=4.4.0
-PKG_RELEASE:=8
+PKG_RELEASE:=9
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2
diff --git a/package/network/utils/iproute2/patches/960-ipmonitor-fix-ip-monitor-can-t-work-when-NET_NS-is-n.patch b/package/network/utils/iproute2/patches/960-ipmonitor-fix-ip-monitor-can-t-work-when-NET_NS-is-n.patch
new file mode 100644
index 0000000000..52be021e72
--- /dev/null
+++ b/package/network/utils/iproute2/patches/960-ipmonitor-fix-ip-monitor-can-t-work-when-NET_NS-is-n.patch
@@ -0,0 +1,40 @@
+From c44003f7e7254ac972eaa1b22a686471ea4ce2d7 Mon Sep 17 00:00:00 2001
+From: Liping Zhang <liping.zhang@spreadtrum.com>
+Date: Tue, 20 Sep 2016 02:09:02 -0700
+Subject: [PATCH] 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 | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/ip/ipnetns.c b/ip/ipnetns.c
+index af87065..ccc652c 100644
+--- a/ip/ipnetns.c
++++ b/ip/ipnetns.c
+@@ -72,8 +72,8 @@ static int ipnetns_have_nsid(void)
+ if (have_rtnl_getnsid < 0) {
+ fd = open("/proc/self/ns/net", O_RDONLY);
+ if (fd < 0) {
+- perror("open(\"/proc/self/ns/net\")");
+- exit(1);
++ have_rtnl_getnsid = 0;
++ return 0;
+ }
+
+ addattr32(&req.n, 1024, NETNSA_FD, fd);
+--
+2.6.4
+