vm/network: do not fail when route already exists - override it

This commit is contained in:
Marek Marczykowski 2012-02-24 17:10:16 +01:00
parent e8e478a482
commit 187c524852

View File

@ -45,7 +45,8 @@ if [ "${ip}" ] ; then
# If we've been given a list of IP addresses, then add routes from dom0 to # If we've been given a list of IP addresses, then add routes from dom0 to
# the guest using those addresses. # the guest using those addresses.
for addr in ${ip} ; do for addr in ${ip} ; do
${cmdprefix} ip route ${ipcmd} ${addr} dev ${vif} ${cmdprefix} ip route del ${addr} || true
${cmdprefix} ip route ${ipcmd} ${addr} dev ${vif} || true
done done
echo ${cmdprefix} iptables $iptables_cmd -i ${vif} \! -s ${ip} -j DROP echo ${cmdprefix} iptables $iptables_cmd -i ${vif} \! -s ${ip} -j DROP
${cmdprefix} iptables $iptables_cmd -i ${vif} \! -s ${ip} -j DROP ${cmdprefix} iptables $iptables_cmd -i ${vif} \! -s ${ip} -j DROP