ia64/xen-unstable

changeset 19672:fe84a14aacd1

Serialize iptables calls in hotplug scripts

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.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu May 28 11:07:19 2009 +0100 (2009-05-28)
parents ae810b258394
children f3bed18decfc
files tools/hotplug/Linux/vif-common.sh
line diff
     1.1 --- a/tools/hotplug/Linux/vif-common.sh	Thu May 28 11:01:00 2009 +0100
     1.2 +++ b/tools/hotplug/Linux/vif-common.sh	Thu May 28 11:07:19 2009 +0100
     1.3 @@ -103,6 +103,8 @@ handle_iptable()
     1.4      return
     1.5    fi
     1.6  
     1.7 +  claim_lock "iptables"
     1.8 +
     1.9    if [ "$ip" != "" ]
    1.10    then
    1.11        local addr
    1.12 @@ -117,6 +119,8 @@ handle_iptable()
    1.13        # No IP addresses have been specified, so allow anything.
    1.14        frob_iptable
    1.15    fi
    1.16 +
    1.17 +  release_lock "iptables"
    1.18  }
    1.19  
    1.20