summaryrefslogtreecommitdiff
path: root/templates/interfaces
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2011-05-07 10:32:10 +0800
committerAn-Cheng Huang <ancheng@vyatta.com>2011-05-10 09:33:37 +0800
commitb517c1438fc6930e9d20eac507aaa3cdbc8c3b4e (patch)
tree2ceb8ce76d86ccd4934fdc91c1978ac9a51d1bcd /templates/interfaces
parentc2174e6faaee38665e9ddff0d6ddd2ddd4921c11 (diff)
downloadvyatta-cfg-system-b517c1438fc6930e9d20eac507aaa3cdbc8c3b4e.tar.gz
vyatta-cfg-system-b517c1438fc6930e9d20eac507aaa3cdbc8c3b4e.zip
more changes for new commit
(cherry picked from commit 11baf27c6caf1a0edf2b993fb7066227d02eab7b)
Diffstat (limited to 'templates/interfaces')
-rw-r--r--templates/interfaces/ethernet/node.def8
-rw-r--r--templates/interfaces/ethernet/node.tag/mac/node.def5
2 files changed, 8 insertions, 5 deletions
diff --git a/templates/interfaces/ethernet/node.def b/templates/interfaces/ethernet/node.def
index 31883c64..0b55de8a 100644
--- a/templates/interfaces/ethernet/node.def
+++ b/templates/interfaces/ethernet/node.def
@@ -14,6 +14,14 @@ syntax:expression: exec \
fi"
begin: rm -f /tmp/speed-duplex.$VAR(@)
+ if [ -d "/sys/class/net/$VAR(@)" ]; then
+ # assume hw-id always exists (as orig impl did)
+ s_mac="$VAR(hw-id/@)"
+ if [ -n "$VAR(mac/@)" ]; then
+ s_mac="$VAR(mac/@)"
+ fi
+ /opt/vyatta/sbin/vyatta-interfaces.pl --dev $VAR(@) --set-mac $s_mac
+ fi
create: ip link set "$VAR(@)" up
/opt/vyatta/sbin/vyatta-link-detect $VAR(@) on
diff --git a/templates/interfaces/ethernet/node.tag/mac/node.def b/templates/interfaces/ethernet/node.tag/mac/node.def
index c9fbb0fe..5b797830 100644
--- a/templates/interfaces/ethernet/node.tag/mac/node.def
+++ b/templates/interfaces/ethernet/node.tag/mac/node.def
@@ -1,9 +1,4 @@
type: macaddr
-priority: 317 # must be set before dhcp client
help: Media Access Control (MAC) address
syntax:expression: exec "\
/opt/vyatta/sbin/vyatta-interfaces.pl --dev $VAR(../@) --valid-mac $VAR(@)"
-update: /opt/vyatta/sbin/vyatta-interfaces.pl --dev $VAR(../@) --set-mac $VAR(@)
-delete: [ -d /sys/class/net/$VAR(../@) ] || exit 0
- /opt/vyatta/sbin/vyatta-interfaces.pl --dev $VAR(../@) --set-mac $VAR(../hw-id/@)
-