From: Wenfeng Liu Date: Mon, 15 Jun 2015 04:07:33 +0000 (-0400) Subject: kni: fix ioctl in container X-Git-Tag: spdx-start~9059 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=790aa264bc34a07bbcc44465b79536fc0a3144b8;p=dpdk.git kni: fix ioctl in container In containers like docker, current->pid returns current process's global PID instead of its own PID under containers's PID namespace, and get_net_ns_by_pid() suppose to accept a virtual PID under its own namespace, so we should use task_pid_vnr(current) to get current process's virtual PID instead of current->pid. Signed-off-by: Wenfeng Liu Acked-by: Helin Zhang --- diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c b/lib/librte_eal/linuxapp/kni/kni_misc.c index 912a8f1804..2e9fa897b9 100644 --- a/lib/librte_eal/linuxapp/kni/kni_misc.c +++ b/lib/librte_eal/linuxapp/kni/kni_misc.c @@ -358,7 +358,7 @@ kni_ioctl_create(unsigned int ioctl_num, unsigned long ioctl_param) return -EBUSY; } - net = get_net_ns_by_pid(current->pid); + net = get_net_ns_by_pid(task_pid_vnr(current)); if (IS_ERR(net)) { free_netdev(net_dev); return PTR_ERR(net);