summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorStefan Knoblich <s.knoblich@axsentis.de>2011-09-17 00:06:00 +0200
committerChristian Ruppert <idl0r@gentoo.org>2011-09-17 00:16:10 +0200
commit645bbf2e0f6be1f9f4cc116dfc39939456b771e3 (patch)
tree618aad155ca2d2d95988808427d6e4bb5c619e11 /net
parent539c4e58723fbd3b8ca9f30a09e99ddaf72c30b1 (diff)
downloadopenrc-645bbf2e0f6be1f9f4cc116dfc39939456b771e3.tar.gz
openrc-645bbf2e0f6be1f9f4cc116dfc39939456b771e3.tar.bz2
openrc-645bbf2e0f6be1f9f4cc116dfc39939456b771e3.tar.xz
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.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/arping.sh b/net/arping.sh
index ef1f9e7..b77d70c 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