hotplug/linux: Fix the vif script to handle_iptable for tap interfaces
authorSylvain Munaut <s.munaut@whatever-company.com>
Tue, 20 May 2014 14:56:43 +0000 (16:56 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 21 May 2014 13:02:27 +0000 (14:02 +0100)
The TAP interfaces need the same iptables rules as the VIF, without it,
traffic will not be forwarded to/from them is the default FORWARD policy
is DROP/REJECT

Signed-off-by: Sylvain Munaut <s.munaut@whatever-company.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/hotplug/Linux/vif-bridge
tools/hotplug/Linux/vif-common.sh

index b7dcbd63de4a04533e7bca8e2e7778c66d1fe419..df447899d3d38f6c0b6f6ae2bcfa0137a7ee30f7 100644 (file)
@@ -97,9 +97,7 @@ case "$command" in
         ;;
 esac
 
-if [ "$type_if" = vif ]; then
-    handle_iptable
-fi
+handle_iptable
 
 call_hooks vif post
 
index 73ee24150a17cfaf711b9e3ba858d0b3d220788d..28ddae583a40b61293b65ae98afa446b8d60507b 100644 (file)
@@ -123,7 +123,7 @@ ip=$(xenstore_read_default "$XENBUS_PATH/ip" "$ip")
 
 frob_iptable()
 {
-  if [ "$command" == "online" ]
+  if [ "$command" == "online" -o "$command" == "add" ]
   then
     local c="-I"
   else
@@ -135,7 +135,7 @@ frob_iptable()
   iptables "$c" FORWARD -m physdev --physdev-is-bridged --physdev-out "$dev" \
     -j ACCEPT 2>/dev/null
 
-  if [ "$command" == "online" -a $? -ne 0 ]
+  if [ \( "$command" == "online" -o "$command" == "add" \) -a $? -ne 0 ]
   then
     log err "iptables setup failed. This may affect guest networking."
   fi