diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2011-08-05 20:51:06 -0700 |
---|---|---|
committer | Stephen Hemminger <shemminger@vyatta.com> | 2011-08-05 20:52:46 -0700 |
commit | 8b49f93b06cfe494182c533dc00499abc8452660 (patch) | |
tree | 9934153ca41927463924c006a8b5a73a94c32695 /templates | |
parent | 429b4ca11b2757e0eb453f9f53bdb08cfe669f8e (diff) | |
download | vyatta-cfg-quagga-8b49f93b06cfe494182c533dc00499abc8452660.tar.gz vyatta-cfg-quagga-8b49f93b06cfe494182c533dc00499abc8452660.zip |
ethernet: avoid needlessly setting mac address
Bug 7408
Only set mac address if it is different, and try first with
link up (many drivers allow it).
Don't use hw-id as mac address, hw-id is meant for corelating
names with addresses (in udev).
Diffstat (limited to 'templates')
-rw-r--r-- | templates/interfaces/ethernet/node.def | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/templates/interfaces/ethernet/node.def b/templates/interfaces/ethernet/node.def index a9113e7a..426f8f87 100644 --- a/templates/interfaces/ethernet/node.def +++ b/templates/interfaces/ethernet/node.def @@ -14,15 +14,10 @@ syntax:expression: exec \ fi" begin: rm -f /tmp/speed-duplex.$VAR(@) - if [ -d "/sys/class/net/$VAR(@)" ]; then - s_mac="$VAR(hw-id/@)" - if [ -n "$VAR(mac/@)" ]; then - s_mac="$VAR(mac/@)" - fi - if [ -n "$s_mac" ]; then + if [ -n "$VAR(mac/@)" ] && + [ -d "/sys/class/net/$VAR(@)" ]; then /opt/vyatta/sbin/vyatta-interfaces.pl --dev $VAR(@) \ - --set-mac $s_mac - fi + --set-mac "$VAR(mac/@)" fi create: ip link set "$VAR(@)" up |