summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-07-07 14:44:58 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2009-07-08 16:54:54 -0700
commit93719883d649d7c21fcb9d193caeea2cb214c221 (patch)
tree5c4f1e3855739aed5604a2254ba0d27aba302ac5
parent0d9103716d32773bdb3cccaceeaeb50743d0cf11 (diff)
downloadvyatta-cfg-93719883d649d7c21fcb9d193caeea2cb214c221.tar.gz
vyatta-cfg-93719883d649d7c21fcb9d193caeea2cb214c221.zip
Use ip command rather than sysfs to set ifalias
Bug 4672 By using ip command instead of sysfs, avoid subshell quoting issues. (cherry picked from commit 1755bfab4b22cc822f96fb78a1e05392d5f07398)
-rw-r--r--templates/interfaces/ethernet/node.tag/description/node.def2
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/description/node.def2
-rw-r--r--templates/interfaces/loopback/node.tag/description/node.def2
3 files changed, 3 insertions, 3 deletions
diff --git a/templates/interfaces/ethernet/node.tag/description/node.def b/templates/interfaces/ethernet/node.tag/description/node.def
index d7becd1..ccec5e1 100644
--- a/templates/interfaces/ethernet/node.tag/description/node.def
+++ b/templates/interfaces/ethernet/node.tag/description/node.def
@@ -1,4 +1,4 @@
type: txt
help: Set description for this interface
-update: sudo sh -c "echo $VAR(@) >/sys/class/net/$VAR(../@)/ifalias"
+update: sudo ip link set $VAR(../@) alias "$VAR(@)"
delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../@)/ifalias"
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/description/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/description/node.def
index 40f04bc..fda2e3c 100644
--- a/templates/interfaces/ethernet/node.tag/vif/node.tag/description/node.def
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/description/node.def
@@ -1,4 +1,4 @@
type: txt
help: Set description for this interface
-update: sudo sh -c "echo $VAR(@) >/sys/class/net/$VAR(../../@).$VAR(../@)/ifalias"
+update: sudo ip link set dev "$VAR(../../@).$VAR(../@)" alias "$VAR(@)"
delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../../@).$VAR(../@)/ifalias"
diff --git a/templates/interfaces/loopback/node.tag/description/node.def b/templates/interfaces/loopback/node.tag/description/node.def
index d7becd1..ccec5e1 100644
--- a/templates/interfaces/loopback/node.tag/description/node.def
+++ b/templates/interfaces/loopback/node.tag/description/node.def
@@ -1,4 +1,4 @@
type: txt
help: Set description for this interface
-update: sudo sh -c "echo $VAR(@) >/sys/class/net/$VAR(../@)/ifalias"
+update: sudo ip link set $VAR(../@) alias "$VAR(@)"
delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../@)/ifalias"