Search Linux Wireless

Problem regarding wifi device with network namespaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm facing some problems with network namespaces and wireless devices. 
If I move a network physical device into a network namespace and then 
try to do any operation on the phy, it will always result into "command 
failed: No such file or directory (-2)" occures. For additional 
informations see below.

I think this is a bug, but maybe there is a good reason for this. If 
it's not a bug, do you have any idea for a workaround? I need a working 
 >iw< inside a network namespace (e.g. sshd in a docker-container).

Thanks in advance,
Tim

PS: Please keep me in CC or send me a quick message if I need to 
subscribe to the mailinglist to follow the thread.


-----------------------------------------

How to reproduce?

#First unshare a process, e.g. a bash
 > unshare -n bash
#Get it's process id
 > echo $$

#in an other terminal
#Move phy to process network namespace
 > iw phy phy0 set netns %PROCESSID%

#in first terminal (unshared bash)
#do any phy operation
 > iw phy phy0 info
#Leads to: command failed: No such file or directory (-2)
#any device related commands still work
 > iw dev wlan0 info

-----------------------------------------

Additional information:

If I use ip netns exec it's working:

#netns is only working with named networks so let's create one
 > ln -sf /proc/%PROCESSID%/ns/net /var/run/netns/test
 > iw phy phy0 set netns %PROCESSID%
#works
 > ip netns exec test iw phy phy0 info
#Still doesn't work, can also be called in unshared bash terminal
 > nsenter -t %PROCESSID% -n iw phy phy0 info

Maybe helpful:

 > ip netns exec test find /sys/class/ieee80211/ | grep phy0
#finds /sys/class/ieee80211/phy0

 > nsenter -t %PROCESSID% -n find /sys/class/ieee80211/ | grep phy0
#no result

-----------------------------------------

Kernel version etc:

This problem occurs with vanilla kernel 4.10.1 x86_64 (stable), iw 
version 4.9 and various wifi devices (Intel 7260, mac80211_hwsim, 
Atheros AR5413). I also tried older distro kernels.






[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux