Skip to contentSkip to conversation

Fix iptables failure test in vif-common.sh

PATCH John Haxby 1 participant 1 message Aug 7, 2009

lore
Share & tools
lore

John Haxby

author
#0 lore raw

In changset 19540 a bug was introduced in the fib_iptable function in vif-common.sh that incorrectly checks the exit status of iptables -- it always believes iptables has failed even when it hasn't.

The attached patch fixes that. It's also bug 1490.

(Inline and attachment, I don't trust this thunderbird beta)

tools/hotplug/Linux/vif-common.sh renamed from tools/hotplug/Linux/vif-common.sh.bug1490 +1 -1
diff -up xen-3.4.0/tools/hotplug/Linux/vif-common.sh.bug1490 xen-3.4.0/tools/hotplug/Linux/vif-common.sh
@@ -78,7 +78,7 @@ frob_iptable()
   iptables "$c" FORWARD -m state --state RELATED,ESTABLISHED -m physdev \
     --physdev-out "$vif" -j ACCEPT 2>/dev/null
 
-  if [ "$command" == "online" ]&&  [ $? ]
+  if [ "$command" == "online" -a $? -ne 0 ]
   then
     log err "iptables setup failed. This may affect guest networking."
   fi
tools/hotplug/Linux/vif-common.sh renamed from tools/hotplug/Linux/vif-common.sh.bug8752713 +1 -1
diff -up xen-3.4.0/tools/hotplug/Linux/vif-common.sh.bug8752713 xen-3.4.0/tools/hotplug/Linux/vif-common.sh
@@ -78,7 +78,7 @@ frob_iptable()
   iptables "$c" FORWARD -m state --state RELATED,ESTABLISHED -m physdev \
     --physdev-out "$vif" -j ACCEPT 2>/dev/null
 
-  if [ "$command" == "online" ] && [ $? ]
+  if [ "$command" == "online" -a $? -ne 0 ]
   then
     log err "iptables setup failed. This may affect guest networking."
   fi

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel