In lines 42-43 in /lib/rc/net/arping.sh: foundmac="$(arping -w "${w}" ${opts} -f -I "${IFACE}" "${ip}" 2>/dev/null | \ sed -n -e 'y/abcdef/ABCDEF/' -e 's/.*\[\([^]]*\)\].*/\1/p')" the sed-regexp extracts the MAC in the *LAST* [...] pairs. That's a problem, if the output of arping is e.g. "Broadcast request from 131.159.71.254 [02:E0:52:EB:55:01] for 131.159.71.254 [00:00:00:00:00:00] 803.297ms Sent 1 probes (1 broadcast(s)) Received 1 response(s) (1 request(s), 1 broadcast(s))" (here arping has received a gratuitous arp request from 131.159.71.254 with the target MAC set to 00:00:... ) The the regexp above extracts the contents of the last [...] pair and the zero-MAC is saved in $foundmac. That's wrong. If the pinged host sends an UNICAST reply the problem doesn't occur, because the output of arping looks like this: "Unicast reply from 192.168.178.1 [00:04:0E:6F:A6:3D] for 192.168.178.1 [00:04:0E:6F:A6:3D] 1.079ms" Reproducible: Always Steps to Reproduce: To reproduce you need a host (router) that regularly sends gratuitous arp requests/replies. 1. Use /etc/conf.d/net with arping-feature config_eth0=( "arping" ) gateways_eth0=( "131.159.71.254,02:E0:52:EB:55:01" ) etc. 2. Bring up network (or restart): /etc/init.d/net.eth0 -v start 3. Read warning-message "Found 131.159.71.254 but MAC 00:00:00:00:00:00 does not match" Actual Results: In the case of broadcast arp-requests the target MAC ($foundmac) isn't detected correctly. Expected Results: Expected: Correct detection of target MAC in $foundmac. I suggest using the *first* [...] pairs in the output of arping. used version of arping net-analyzer/arping-2.06
Hrm.. Either we add support for both versions (iputils/arping) or we support and esp. use only one, in this case iputils as the pattern works well and seems to be written for iputils arping.
Ok, it seems both versions are supported and the regex pattern is fine for both so far.. We'll have to take a closer look at it.
arping2 uses the -r option so it outputs the MAC only (see man 8 arping2). arping2 will be preferred over arping (iputils). Please attach the full output of /etc/init.d/net.eth0 -v restart Also emerge --info please as well as the iputils version.
Created attachment 286673 [details] emerge --info
Testing the case: * net-analyzer/arping Latest version available: 2.06 Latest version installed: [ Not Installed ] * net-misc/iputils Latest version available: 20100418-r1 Latest version installed: 20100418-r1 /etc/init.d/net.eth0 -v restart reports: * Bringing up interface eth0 * Loaded modules: apipa arping bonding tuntap bridge ccwgroup macchanger macnet wpa_supplicant ssidnet ifconfig system dhcpcd ip6to4 * Configuring eth0 for MAC address 00:25:b3:c0:e8:25 ... [ ok ] * arping ... * Pinging gateways on eth0 for configuration * 131.159.71.254 (MAC 02:E0:52:EB:55:01) ... * Found 131.159.71.254 but MAC 00:00:00:00:00:00 does not match [ !! ] * 131.159.68.2 (MAC 00:03:BA:65:2C:63) ... [ !! ] * 131.159.68.4 (MAC 00:03:BA:D8:BD:B3) ... [ !! ] * 192.168.178.1 (MAC 00:04:0E:6F:A6:3D) ... [ !! ] [ !! ] * Trying fallback configuration dhcp * dhcp ... * Running dhcpcd ...dhcpcd[1896]: version 5.2.12 starting dhcpcd[1896]: eth0: broadcasting for a lease dhcpcd[1896]: timed out [ !! ] [ !! ] * ERROR: net.eth0 failed to start
Ok, so as expected you *don't* use net-analyzer/arping at all. This should be fixed through commit 645bbf2 - http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=645bbf2e0f6be1f9f4cc116dfc39939456b771e3 Please try openrc-9999 or patch your current openrc: # wget 'http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=patch;h=645bbf2e0f6be1f9f4cc116dfc39939456b771e3;hp=539c4e58723fbd3b8ca9f30a09e99ddaf72c30b1' -O /tmp/arping.patch # cd /lib/rc/net; patch -p2 < /tmp/arping.patch
"Ok, so as expected you *don't* use net-analyzer/arping at all." Sorry, yes. Only using iputils. The patch http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=patch;h=645bbf2e0f6be1f9f4cc116dfc39939456b771e3;hp=539c4e58723fbd3b8ca9f30a09e99ddaf72c30b1 worked for me. Thanks