projects
/
invirt/packages/invirt-xen-config.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't pass a src argument to 'ip route del' in case the host's "main IP"
[invirt/packages/invirt-xen-config.git]
/
vif-invirtroute
diff --git
a/vif-invirtroute
b/vif-invirtroute
index
9f833dc
..
69ca710
100755
(executable)
--- a/
vif-invirtroute
+++ b/
vif-invirtroute
@@
-77,7
+77,9
@@
if [ ${vif_type} != "ioemu" -o x${qemu_online} = xyes ] ; then
# (with metric 1) should take precedence over the vif
# route and carry all the traffic.
# (with metric 1) should take precedence over the vif
# route and carry all the traffic.
+ src=""
if [ $ipcmd == "add" ]; then
if [ $ipcmd == "add" ]; then
+ src="src ${main_ip}"
case $dev in
vif*)
metric="metric 2"
case $dev in
vif*)
metric="metric 2"
@@
-87,7
+89,7
@@
if [ ${vif_type} != "ioemu" -o x${qemu_online} = xyes ] ; then
;;
esac
fi
;;
esac
fi
- ${cmdprefix} ip route ${ipcmd} ${addr} dev ${dev} src ${main_ip} $metric
+ ${cmdprefix} ip route ${ipcmd} ${addr} dev ${dev} ${src} $metric
case "$command" in
online|add)
timeout 5 arpspoof -i $(invirt-getconf xen.iface) -t ${gateway} ${addr} || :
case "$command" in
online|add)
timeout 5 arpspoof -i $(invirt-getconf xen.iface) -t ${gateway} ${addr} || :
@@
-95,7
+97,7
@@
if [ ${vif_type} != "ioemu" -o x${qemu_online} = xyes ] ; then
esac
done
if [ -n "$other_ip" ]; then
esac
done
if [ -n "$other_ip" ]; then
- ${cmdprefix} ip route ${ipcmd} ${other_ip} dev ${dev} src ${main_ip} $metric
+ ${cmdprefix} ip route ${ipcmd} ${other_ip} dev ${dev} ${src} $metric
iptables -t nat ${ipt_action} PREROUTING -d ${other_ip} -j DNAT --to-destination ${addr}
case "$command" in
online|add)
iptables -t nat ${ipt_action} PREROUTING -d ${other_ip} -j DNAT --to-destination ${addr}
case "$command" in
online|add)