Use iptables --wait only when it is supported
This commit is contained in:
parent
32374123cd
commit
7adbc3fd59
@ -47,13 +47,17 @@ domid=${domid/.*/}
|
||||
# 32752 is max XID aka domid
|
||||
metric=$[ 32752 - $domid ]
|
||||
|
||||
if iptables --help |grep -q -- --wait; then
|
||||
wait=--wait
|
||||
fi
|
||||
|
||||
if [ "${ip}" ] ; then
|
||||
# If we've been given a list of IP addresses, then add routes from dom0 to
|
||||
# the guest using those addresses.
|
||||
for addr in ${ip} ; do
|
||||
${cmdprefix} ip route ${ipcmd} ${addr} dev ${vif} metric $metric
|
||||
done
|
||||
${cmdprefix} iptables -w -t raw $iptables_cmd -i ${vif} \! -s ${ip} -j DROP
|
||||
${cmdprefix} iptables $wait -t raw $iptables_cmd -i ${vif} \! -s ${ip} -j DROP
|
||||
back_ip=`qubesdb-read /qubes-netvm-gateway`
|
||||
${cmdprefix} ip addr ${ipcmd} ${back_ip}/32 dev ${vif}
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user