* [PATCH] fix network-bridge stop
@ 2005-09-14 15:51 Andrew Theurer
2005-09-14 16:39 ` Keir Fraser
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Theurer @ 2005-09-14 15:51 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 250 bytes --]
During my attempts to get the latest bridge networking model working on my
system, I often invoked 'network-bridge stop' with total failure. Attached
is an updated version that works.
-Andrew
signed-off-by: Andrew Theurer <habanero@us.ibm.com>
[-- Attachment #2: network-bridge.patch --]
[-- Type: text/x-diff, Size: 1471 bytes --]
diff -Naurp xen-unstable.hg-before/tools/examples/network-bridge xen-unstable.hg-after/tools/examples/network-bridge
--- xen-unstable.hg-before/tools/examples/network-bridge 2005-09-14 09:43:44.000000000 -0500
+++ xen-unstable.hg-after/tools/examples/network-bridge 2005-09-14 10:09:12.000000000 -0500
@@ -222,20 +222,24 @@ op_stop () {
return
fi
- brctl delif ${bridge} ${netdev}
+ if ifconfig peth0 2>/dev/null | grep -q peth0 ; then
+
+ ifconfig vif0.0 down
+ mac=`ifconfig eth0 | grep HWadd | \
+ sed -e 's/.*\(..:..:..:..:..:..\).*/\1/'`
+ ifconfig ${netdev} 0.0.0.0 down
+ ifconfig ${netdev} hw ether fe:ff:ff:ff:ff:ff
+
+ ifconfig p${netdev} down
+ ifconfig p${netdev} hw ether ${mac} arp
+ brctl delif ${bridge} p${netdev}
+
+ ip link set eth0 name veth0
+ ip link set peth0 name eth0
+ ifconfig ${bridge} down
+ brctl delbr ${bridge}
+ ifup eth0
- if ifconfig veth0 2>/dev/null | grep -q veth0 ; then
- brctl delif ${bridge} vif0.0
- ifconfig vif0.0 down
- mac=`ifconfig veth0 | grep HWadd | sed -e 's/.*\(..:..:..:..:..:..\).*/\1/'`
- ifconfig ${netdev} down
- ifconfig ${netdev} hw ether ${mac}
- ifconfig ${netdev} arp up
- transfer_addrs veth0 ${netdev}
- transfer_routes veth0 ${netdev}
- del_addrs veth0
- ifconfig veth0 -arp down
- ifconfig veth0 hw ether 00:00:00:00:00:00
else
transfer_routes ${bridge} ${netdev}
fi
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fix network-bridge stop
2005-09-14 15:51 [PATCH] fix network-bridge stop Andrew Theurer
@ 2005-09-14 16:39 ` Keir Fraser
2005-09-14 17:25 ` Andrew Theurer
0 siblings, 1 reply; 4+ messages in thread
From: Keir Fraser @ 2005-09-14 16:39 UTC (permalink / raw)
To: habanero; +Cc: xen-devel
On 14 Sep 2005, at 16:51, Andrew Theurer wrote:
> During my attempts to get the latest bridge networking model working
> on my
> system, I often invoked 'network-bridge stop' with total failure.
> Attached
> is an updated version that works.
Just to clarify: presumably the problem with the current script, that
your patch fixes, is that it tests for and tears down veth0, when in
fact veth0 has been renamed to eth0, and eth0 to peth0? :-)
-- Keir
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fix network-bridge stop
2005-09-14 16:39 ` Keir Fraser
@ 2005-09-14 17:25 ` Andrew Theurer
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Theurer @ 2005-09-14 17:25 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel
Keir Fraser wrote:
>
> On 14 Sep 2005, at 16:51, Andrew Theurer wrote:
>
>> During my attempts to get the latest bridge networking model working
>> on my
>> system, I often invoked 'network-bridge stop' with total failure.
>> Attached
>> is an updated version that works.
>
>
> Just to clarify: presumably the problem with the current script, that
> your patch fixes, is that it tests for and tears down veth0, when in
> fact veth0 has been renamed to eth0, and eth0 to peth0? :-)
Yes, the script in current xen-unstable, when running "stop", tests for
veth0, which does not exist because it has been renamed to eth0. It now
tests for peth0, since that is the only real indication that veth0 was
used in the first place. There are other small fixes like removal or
hard coded "peth0", removal of unconditional 'brctl delif xen-br0 eth0',
and reversal of ethernet naming.
-Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] fix network-bridge stop
@ 2005-09-14 20:50 Ian Pratt
0 siblings, 0 replies; 4+ messages in thread
From: Ian Pratt @ 2005-09-14 20:50 UTC (permalink / raw)
To: Andrew Theurer, Keir Fraser; +Cc: xen-devel
> Yes, the script in current xen-unstable, when running "stop",
> tests for veth0, which does not exist because it has been
> renamed to eth0. It now tests for peth0, since that is the
> only real indication that veth0 was
> used in the first place. There are other small fixes like
> removal or
> hard coded "peth0", removal of unconditional 'brctl delif
> xen-br0 eth0', and reversal of ethernet naming.
Thanks for tidying that up -- its been on my todo list. Putting the
networking back as it was is quite a dangerous game, so its not
something we want to invoke automatically.
BTW: it might be worth experimenting with inserting 'ip route cache
flush' runes in a couple of the places in the script to avoid the stall
in ssh connections when invoking network-bridge start.
Thanks,
Ian
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-09-14 20:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-14 15:51 [PATCH] fix network-bridge stop Andrew Theurer
2005-09-14 16:39 ` Keir Fraser
2005-09-14 17:25 ` Andrew Theurer
-- strict thread matches above, loose matches on Subject: below --
2005-09-14 20:50 Ian Pratt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.