From: Jiri Denemark Subject: [PATCH] Serialize iptables calls in hotplug scripts Date: Thu, 28 May 2009 11:41:24 +0200 Message-ID: <20090528094124.GA3524@orkuz.home> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="yrj/dFKFPuw6o+aM" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, iptables cannot correctly handle situations when more than one command is trying to set netfilter rules. In such situations, iptables may fail with EAGAIN, which results in iptables: Unknown error 18446744073709551615. Such situation can easily happen when multiple network devices are configured for a domain as vif hotplug scripts are called in parallel for all of the network devices. Attached is a patch which serializes all iptables calls from vif-* hotplug scripts... Signed-off-by: Jiri Denemark --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xen-hotplug-serialize-iptables.patch" diff -r fe68405201d2 tools/hotplug/Linux/vif-common.sh --- a/tools/hotplug/Linux/vif-common.sh Wed May 27 15:55:29 2009 +0100 +++ b/tools/hotplug/Linux/vif-common.sh Thu May 28 09:07:20 2009 +0200 @@ -103,6 +103,8 @@ handle_iptable() return fi + claim_lock "iptables" + if [ "$ip" != "" ] then local addr @@ -117,6 +119,8 @@ handle_iptable() # No IP addresses have been specified, so allow anything. frob_iptable fi + + release_lock "iptables" } --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --yrj/dFKFPuw6o+aM--