diff options
author | Stefan Knoblich <s.knoblich@axsentis.de> | 2011-09-17 00:06:00 +0200 |
---|---|---|
committer | Christian Ruppert <idl0r@gentoo.org> | 2011-09-17 00:16:10 +0200 |
commit | 645bbf2e0f6be1f9f4cc116dfc39939456b771e3 (patch) | |
tree | 618aad155ca2d2d95988808427d6e4bb5c619e11 /net | |
parent | 539c4e58723fbd3b8ca9f30a09e99ddaf72c30b1 (diff) |
Parse broadcast arp responses via arping (iputils) properly
ARP replies may/do contain two MAC addresses when using iputils's
arping so we have to use the first one because it's always the "From"
address - which is what we want.
Thanks to Stefan Knoblich <s.knoblich@axsentis.de> for the fixed pattern.
Reported-by: cl@exomail.to
X-Gentoo-Bug: 379181
X-Gentoo-Bug-URL: https://bugs.gentoo.org/379181
Diffstat (limited to 'net')
-rw-r--r-- | net/arping.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/arping.sh b/net/arping.sh index ef1f9e7a..b77d70c1 100644 --- a/net/arping.sh +++ b/net/arping.sh @@ -40,7 +40,7 @@ arping_address() [ -z "$(_get_inet_address)" ] && opts="${opts} -D" foundmac="$(arping -w "${w}" ${opts} -f -I "${IFACE}" "${ip}" 2>/dev/null | \ - sed -n -e 'y/abcdef/ABCDEF/' -e 's/.*\[\([^]]*\)\].*/\1/p')" + sed -n -e 'y/abcdef/ABCDEF/' -e 's/[^[]*\[\([^]]*\)\].*/\1/p')" fi [ -z "${foundmac}" ] && return 1 |