From: Sylvain Munaut Subject: [PATCH 1/5] hotplug/linux: Fix the vif script to handle_iptable for tap interfaces Date: Wed, 14 May 2014 17:23:21 +0200 Message-ID: <1400081005-23895-2-git-send-email-s.munaut@whatever-company.com> References: <1400081005-23895-1-git-send-email-s.munaut@whatever-company.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wkb1n-0000Ot-B7 for xen-devel@lists.xenproject.org; Wed, 14 May 2014 15:23:31 +0000 In-Reply-To: <1400081005-23895-1-git-send-email-s.munaut@whatever-company.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Sylvain Munaut List-Id: xen-devel@lists.xenproject.org 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 --- tools/hotplug/Linux/vif-bridge | 2 +- tools/hotplug/Linux/vif-common.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/hotplug/Linux/vif-bridge b/tools/hotplug/Linux/vif-bridge index b7dcbd6..87279df 100644 --- a/tools/hotplug/Linux/vif-bridge +++ b/tools/hotplug/Linux/vif-bridge @@ -97,7 +97,7 @@ case "$command" in ;; esac -if [ "$type_if" = vif ]; then +if [ "$type_if" = vif -o "$type_if" = tap ]; then handle_iptable fi diff --git a/tools/hotplug/Linux/vif-common.sh b/tools/hotplug/Linux/vif-common.sh index 73ee241..28ddae5 100644 --- a/tools/hotplug/Linux/vif-common.sh +++ b/tools/hotplug/Linux/vif-common.sh @@ -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 -- 1.7.10.4