projects
/
invirt/packages/invirt-xen-config.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2545d05
)
Don't try to add the same interface to the bridge twice, and clean up old routing...
author
Quentin Smith
<quentin@mit.edu>
Sun, 2 Jan 2011 05:44:58 +0000
(
00:44
-0500)
committer
Quentin Smith
<quentin@mit.edu>
Sun, 2 Jan 2011 05:45:43 +0000
(
00:45
-0500)
vif-invirtroute
patch
|
blob
|
history
diff --git
a/vif-invirtroute
b/vif-invirtroute
index
83a1e08
..
f473ac9
100755
(executable)
--- a/
vif-invirtroute
+++ b/
vif-invirtroute
@@
-14,6
+14,7
@@
#
# Environment vars:
# vif vif interface name (required).
#
# Environment vars:
# vif vif interface name (required).
+# dev qemu interface name (optional)
# XENBUS_PATH path to this device's details in the XenStore (required).
# Read from the store:
# ip list of IP networks for the vif, space-separated (default given in
# XENBUS_PATH path to this device's details in the XenStore (required).
# Read from the store:
# ip list of IP networks for the vif, space-separated (default given in
@@
-34,11
+35,13
@@
brname=dom${vif#vif}
case "$command" in
online)
case "$command" in
online)
- setup_bridge_port ${dev}
- setup_bridge_port ${vif}
create_bridge ${brname}
create_bridge ${brname}
+ setup_bridge_port ${dev}
add_to_bridge ${brname} ${dev}
add_to_bridge ${brname} ${dev}
- add_to_bridge ${brname} ${vif}
+ if [ "$dev" != "$vif" ]; then
+ setup_bridge_port ${vif}
+ add_to_bridge ${brname} ${vif}
+ fi
ifconfig ${brname} ${main_ip} netmask 255.255.255.255 up
echo 1 >/proc/sys/net/ipv4/conf/${brname}/proxy_arp
echo 1 >/proc/sys/net/ipv4/conf/${brname}/rp_filter
ifconfig ${brname} ${main_ip} netmask 255.255.255.255 up
echo 1 >/proc/sys/net/ipv4/conf/${brname}/proxy_arp
echo 1 >/proc/sys/net/ipv4/conf/${brname}/rp_filter
@@
-63,6
+66,9
@@
if [ ${vif_type} != "ioemu" -o x${qemu_online} = xyes ] ; then
# the guest using those addresses.
for addr in ${ip} ; do
${cmdprefix} ip route ${ipcmd} ${addr} dev ${brname} src ${main_ip}
# the guest using those addresses.
for addr in ${ip} ; do
${cmdprefix} ip route ${ipcmd} ${addr} dev ${brname} src ${main_ip}
+ if [ "$ipcmd" == "del" ]; then
+ do_without_error ip route del ${addr} dev ${dev} src ${main_ip}
+ fi
if [ "$command" == "online" ]; then
arpspoof -i $(invirt-getconf xen.iface) -t 18.181.0.1 ${addr}&
sleep 5
if [ "$command" == "online" ]; then
arpspoof -i $(invirt-getconf xen.iface) -t 18.181.0.1 ${addr}&
sleep 5