Red Hat Bugzilla – Bug 963927
arping is not compatible with network namespaces
Last modified: 2016-04-26 09:53:24 EDT
Description of problem:
Attempting to invoke arping in a network namespace (presuming a netns-supporting kernel and iproute2 have been ocnfigured) does not work.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Install a netns-supporting kernel/kernel-firmware/iproute.
2. Add a namespace: ip netns add namespace1
3. Add a veth pair: ip link add v0 type veth peer name v1 netns namespace1
4. Bring the netns device up: ip netns namespace1 exec ip link set v1 up
5: Invoke arping in the namespace on any ip: ip netns namespace1 arping -A -U -I v1 192.168.1.1
Stderr: 'sysfs read broadcast value: No such file or directory'
ARPING 192.168.1.1 from 192.168.1.1 veth0
Sent 3 probes (3 broadcast(s))
Received 0 response(s)
Created attachment 749104 [details]
The background for this is that the netns backport for 6.5 is not complete and does not include the sysfs bits. This leads to the /sys/class/net/$DEV/ directory not being available in the non default netns. arping reads its broadcast address via sysfs.
The following workaround has been used successfully in combination with the netns backport and RHOS. It's a POC patch that should be converted into a fallback alternative if the sysfs broadcast file is not available, i.e. fall back to using a default broadcast address of '-1' if the broadcast address can't be read.
Alternatively the broadcast address could be read from a source other than sysfs, e.f. by parsing the output of 'ip link' or by issueing a netlink request which are both netns aware.
Thomas, is there a possibility that the broadcast address could be anything else than all 0xff's? I'm not aware that it happens, so I think that the workaround patch is ok to apply, *as long as it gets removed once the netns backport is completed*.
(In reply to Jan Synacek from comment #5)
> Thomas, is there a possibility that the broadcast address could be anything
> else than all 0xff's? I'm not aware that it happens, so I think that the
> workaround patch is ok to apply, *as long as it gets removed once the netns
> backport is completed*.
It could differ but only in very rare situations. What seems to be the best option forward is to fall back to all 0xff's if the sysfs file cannot be read.
I agree. I'll write a patch doing exactly that.
I'm setting the old needinfo flags that should have stayed there back.
Created attachment 751541 [details]
[Patch] fall back when sysfs broadcast file is not readable