[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] hotplug/Linux: update to new ip command syntax.



commit f400f2993b52e820d0da24a2e49a8fdfab0d2827
Author:     Mike <debian@xxxxxxxxxxxxxxxxxxxxx>
AuthorDate: Fri Aug 16 15:31:43 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CommitDate: Thu Nov 21 18:43:42 2013 +0000

    hotplug/Linux: update to new ip command syntax.
    
    The current usage prevents naming a vif "dev". Although the current syntax 
is
    documented in Squeeze's ip(8) it appears that this was a documentation bug.
    Newer versions of the man page describe the new syntax used here and 
Squeeze's
    implementation accepts it as well.
    
    This is Debian bug #705659.
    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=705659
    
    Mike provided the initial patch to tools/hotplug/Linux/xen-network-common.sh
    and Ian extended it to catch some cases in vif-* too.
    
    Signed-off-by: Ian Campbell <ijc@xxxxxxxxxxxxxx>
    Signed-off-by: Mike <debian@xxxxxxxxxxxxxxxxxxxxx>
    Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
    Release-acked-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
---
 tools/hotplug/Linux/vif-bridge            |    2 +-
 tools/hotplug/Linux/vif-nat               |    2 +-
 tools/hotplug/Linux/xen-network-common.sh |   14 +++++++-------
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/tools/hotplug/Linux/vif-bridge b/tools/hotplug/Linux/vif-bridge
index 678262d..b7dcbd6 100644
--- a/tools/hotplug/Linux/vif-bridge
+++ b/tools/hotplug/Linux/vif-bridge
@@ -72,7 +72,7 @@ else
 fi
 
 RET=0
-ip link show $bridge 1>/dev/null 2>&1 || RET=1
+ip link show dev $bridge 1>/dev/null 2>&1 || RET=1
 if [ "$RET" -eq 1 ]
 then
     fatal "Could not find bridge device $bridge"
diff --git a/tools/hotplug/Linux/vif-nat b/tools/hotplug/Linux/vif-nat
index 8d29fb6..0b900d5 100644
--- a/tools/hotplug/Linux/vif-nat
+++ b/tools/hotplug/Linux/vif-nat
@@ -170,7 +170,7 @@ case "$command" in
           exit 0
         fi
 
-        do_or_die ip link set "${dev}" up arp on
+        do_or_die ip link set dev "${dev}" up arp on
         do_or_die ip addr add "$router_ip" dev "${dev}"
         do_or_die ip route add "$vif_ip" dev "${dev}" src "$router_ip"
         echo 1 >/proc/sys/net/ipv4/conf/${dev}/proxy_arp
diff --git a/tools/hotplug/Linux/xen-network-common.sh 
b/tools/hotplug/Linux/xen-network-common.sh
index 50b8711..3c63c55 100644
--- a/tools/hotplug/Linux/xen-network-common.sh
+++ b/tools/hotplug/Linux/xen-network-common.sh
@@ -85,18 +85,18 @@ _setup_bridge_port() {
     local virtual="$2"
 
     # take interface down ...
-    ip link set ${dev} down
+    ip link set dev ${dev} down
 
     if [ $virtual -ne 0 ] ; then
         # Initialise a dummy MAC address. We choose the numerically
         # largest non-broadcast address to prevent the address getting
         # stolen by an Ethernet bridge for STP purposes.
         # (FE:FF:FF:FF:FF:FF)
-        ip link set ${dev} address fe:ff:ff:ff:ff:ff || true
+        ip link set dev ${dev} address fe:ff:ff:ff:ff:ff || true
     fi
 
     # ... and configure it
-    ip addr flush ${dev}
+    ip address flush dev ${dev}
 }
 
 setup_physical_bridge_port() {
@@ -125,20 +125,20 @@ add_to_bridge () {
 
     # Don't add $dev to $bridge if it's already on a bridge.
     if [ -e "/sys/class/net/${bridge}/brif/${dev}" ]; then
-       ip link set ${dev} up || true
+       ip link set dev ${dev} up || true
        return
     fi
     brctl addif ${bridge} ${dev}
-    ip link set ${dev} up
+    ip link set dev ${dev} up
 }
 
 # Usage: set_mtu bridge dev
 set_mtu () {
     local bridge=$1
     local dev=$2
-    mtu="`ip link show ${bridge}| awk '/mtu/ { print $5 }'`"
+    mtu="`ip link show dev ${bridge}| awk '/mtu/ { print $5 }'`"
     if [ -n "$mtu" ] && [ "$mtu" -gt 0 ]
     then
-            ip link set ${dev} mtu $mtu || :
+            ip link set dev ${dev} mtu $mtu || :
     fi
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.