From 5797e058c76ab6b7caaeac8ca2255ad52c6b7912 Mon Sep 17 00:00:00 2001 From: el_cubano Date: Tue, 18 Nov 2008 21:31:32 +0000 Subject: [PATCH] Merge multiple provider over single interface speedup from branches/4.2 git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@8878 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/prog.header | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Shorewall-perl/prog.header b/Shorewall-perl/prog.header index a0188edfe..acf362a81 100644 --- a/Shorewall-perl/prog.header +++ b/Shorewall-perl/prog.header @@ -988,18 +988,20 @@ find_echo() { # find_mac() # $1 = IP address, $2 = interface { - qt ping -nc 1 -t 2 -I $2 $1 + if interface_is_usable $2 ; then + qt ping -nc 1 -t 2 -I $2 $1 - local result - result=$(arp -na | awk "/[(]$1[)].* $2$/ {print \$4}") + local result + result=$(arp -na | awk "/[(]$1[)].* $2$/ {print \$4}") - case $result in - \<*\>) - ;; - *) - [ -n "$result" ] && echo $result - ;; - esac + case $result in + \<*\>) + ;; + *) + [ -n "$result" ] && echo $result + ;; + esac + fi } #