summaryrefslogtreecommitdiff
path: root/templates/interfaces/ethernet
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-11-08 13:35:07 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-11-08 13:58:17 -0800
commit1df58b23bac61caf78f28f549e180a3189986689 (patch)
tree55d43e25973a7373989b439e3dcc5e36602da63c /templates/interfaces/ethernet
parent6285193ed1a9b4cf2b85ce6d4f44942663137c48 (diff)
downloadvyatta-cfg-system-1df58b23bac61caf78f28f549e180a3189986689.tar.gz
vyatta-cfg-system-1df58b23bac61caf78f28f549e180a3189986689.zip
Check speed and duplex settings on Ethernet interfaces
Bug 4994 Use ethtool to check for supported speed and duplex values on link.
Diffstat (limited to 'templates/interfaces/ethernet')
-rw-r--r--templates/interfaces/ethernet/node.tag/duplex/node.def7
-rw-r--r--templates/interfaces/ethernet/node.tag/speed/node.def7
2 files changed, 8 insertions, 6 deletions
diff --git a/templates/interfaces/ethernet/node.tag/duplex/node.def b/templates/interfaces/ethernet/node.tag/duplex/node.def
index 0351365f..023a8a08 100644
--- a/templates/interfaces/ethernet/node.tag/duplex/node.def
+++ b/templates/interfaces/ethernet/node.tag/duplex/node.def
@@ -4,9 +4,10 @@ default: "auto"
syntax:expression: $VAR(@) in "auto", "half", "full"; "duplex must be auto, half or full"
allowed: echo auto half full
-commit:expression: ( $VAR(@) == "auto" && $VAR(../speed/@) == "auto" ) || \
- ( $VAR(@) != "auto" && $VAR(../speed/@) != "auto" ) ; \
- "if duplex is hardcoded, speed must also be hardcoded"
+commit:expression: exec " \
+ /opt/vyatta/sbin/vyatta-interfaces.pl --dev=$VAR(../@) \
+ --check-speed $VAR(../speed/@) $VAR(@)"
+
update: /opt/vyatta/sbin/vyatta-interfaces.pl --dev=$VAR(../@) \
--speed-duplex $VAR(../speed/@) $VAR(@)
diff --git a/templates/interfaces/ethernet/node.tag/speed/node.def b/templates/interfaces/ethernet/node.tag/speed/node.def
index fbdc5893..fad248af 100644
--- a/templates/interfaces/ethernet/node.tag/speed/node.def
+++ b/templates/interfaces/ethernet/node.tag/speed/node.def
@@ -4,9 +4,10 @@ default: "auto"
syntax:expression: $VAR(@) in "auto", "10", "100", "1000", "2500", "10000"; "Speed must be auto, 10, 100, 1000, 2500, or 10000"
allowed: echo auto 10 100 1000 2500 10000
-commit:expression: ( $VAR(@) == "auto" && $VAR(../duplex/@) == "auto" ) || \
- ( $VAR(@) != "auto" && $VAR(../duplex/@) != "auto" ) ; \
- "if speed is hardcoded, duplex must also be hardcoded"
+commit:expression: exec "\
+ /opt/vyatta/sbin/vyatta-interfaces.pl --dev=$VAR(../@) \
+ --check-speed $VAR(@) $VAR(../duplex/@)"
+
update: /opt/vyatta/sbin/vyatta-interfaces.pl --dev=$VAR(../@) \
--speed-duplex $VAR(@) $VAR(../duplex/@)