diff --git a/Shorewall-perl/prog.header b/Shorewall-perl/prog.header index f3fc09f7e..569e1ec45 100644 --- a/Shorewall-perl/prog.header +++ b/Shorewall-perl/prog.header @@ -912,11 +912,17 @@ find_mac() # $1 = IP address, $2 = interface { qt ping -nc 1 -t 2 -I $2 $1 - local result=$(arp -na | awk "/[(]$1[)].* on $2$/ {print \$4}") + local result=$(arp -na | awk "/[(]$1[)].* $2$/ {print \$4}") - [ -n "$result" -a "$result" != "" ] || fatal_error "Cannot determine the MAC address of $1 through $2" + case $result in + \<*\>) + ;; + *) + [ -n "$result" ] && echo $result && return + ;; + esac - echo $result + fatal_error "Cannot determine the MAC address of $1 through $2" } ################################################################################