summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-12-21 12:39:58 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-12-21 12:39:58 -0800
commit06891fefd79590da394d32a81a0a6942db10c6e5 (patch)
tree126ad008b51c627b0dcb1bdcf30ba73de9b3d741 /scripts
parentb11c7cd690aab5f07c90df0d8a638428856e88c8 (diff)
downloadvyatta-cfg-quagga-06891fefd79590da394d32a81a0a6942db10c6e5.tar.gz
vyatta-cfg-quagga-06891fefd79590da394d32a81a0a6942db10c6e5.zip
Don't allow setting speed/duplex if hardware doesn't support it
Bug 4994 If hardware does not have ethtool interface to allow setting speed/duplex, then do not allow user to commit change.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-interfaces.pl6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl
index a496e66b..caba8b6f 100755
--- a/scripts/vyatta-interfaces.pl
+++ b/scripts/vyatta-interfaces.pl
@@ -580,8 +580,10 @@ sub set_speed_duplex {
if ($autoneg) {
return if ($nspeed eq 'auto');
} else {
- return if (defined $ospeed && defined $oduplex &&
- $nspeed eq $ospeed && $nduplex eq $oduplex);
+ die "Device $intf does not support setting speed/duplex\n"
+ unless (defined($ospeed) && defined($oduplex));
+
+ return if (($nspeed eq $ospeed) && ($nduplex eq $oduplex));
}
my @cmd = ('sudo', 'ethtool', '-s', $intf );