WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] network:

ChangeSet 1.1637, 2005/06/02 13:40:53+01:00, cl349@xxxxxxxxxxxxxxxxxxxx

        network:
          - remove route added by setting addr/netmask on new interface
          - do exact match on interface names (eth0 matches veth0 otherwise)
        Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>



 network |   27 +++++++++++++++++----------
 1 files changed, 17 insertions(+), 10 deletions(-)


diff -Nru a/tools/examples/network b/tools/examples/network
--- a/tools/examples/network    2005-06-02 10:02:52 -04:00
+++ b/tools/examples/network    2005-06-02 10:02:52 -04:00
@@ -72,6 +72,12 @@
 s@\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+/[0-9]\+\)@\1@
 s/${src}/dev ${dst}/
 " | sh -e
+    # Remove automatic routes on destionation device
+    ip route list | sed -ne "
+/dev ${dst}\( \|$\)/ {
+  s/^/ip route del /
+  p
+}" | sh -e
 }
 
 # Usage: del_addrs src
@@ -95,16 +101,17 @@
     # List all routes and grep the ones with $src in.
     # Stick 'ip route del' on the front to delete.
     # Change $src to $dst and use 'ip route add' to add.
-    ip route list | grep ${src} | sed -e "
-h
-s/^/ip route del /
-P
-g
-s/${src}/${dst}/
-s/^/ip route add /
-P
-d
-" | sh -e
+    ip route list | sed -ne "
+/dev ${src}\( \|$\)/ {
+  h
+  s/^/ip route del /
+  P
+  g
+  s/${src}/${dst}/
+  s/^/ip route add /
+  P
+  d
+}" | sh -e
 }
 
 # Usage: create_bridge bridge

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>