From 645bbf2e0f6be1f9f4cc116dfc39939456b771e3 Mon Sep 17 00:00:00 2001 From: Stefan Knoblich Date: Sat, 17 Sep 2011 00:06:00 +0200 Subject: [PATCH] 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 for the fixed pattern. Reported-by: cl@exomail.to X-Gentoo-Bug: 379181 X-Gentoo-Bug-URL: https://bugs.gentoo.org/379181 --- net/arping.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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