From: Sylvain Munaut Subject: [PATCH 1/5] hotplug/linux: Fix the vif script to handle_iptable for tap interfaces Date: Tue, 20 May 2014 16:56:43 +0200 Message-ID: <1400597807-5715-2-git-send-email-s.munaut@whatever-company.com> References: <1400597807-5715-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 1WmlTK-0001Ft-DJ for xen-devel@lists.xenproject.org; Tue, 20 May 2014 14:56:54 +0000 In-Reply-To: <1400597807-5715-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 , ian.campbell@citrix.com 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 | 4 +--- tools/hotplug/Linux/vif-common.sh | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/hotplug/Linux/vif-bridge b/tools/hotplug/Linux/vif-bridge index b7dcbd6..df44789 100644 --- a/tools/hotplug/Linux/vif-bridge +++ b/tools/hotplug/Linux/vif-bridge @@ -97,9 +97,7 @@ case "$command" in ;; esac -if [ "$type_if" = vif ]; then - handle_iptable -fi +handle_iptable call_hooks vif post 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