diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-12-21 12:39:58 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-12-21 12:39:58 -0800 |
commit | 06891fefd79590da394d32a81a0a6942db10c6e5 (patch) | |
tree | 126ad008b51c627b0dcb1bdcf30ba73de9b3d741 | |
parent | b11c7cd690aab5f07c90df0d8a638428856e88c8 (diff) | |
download | vyatta-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.
-rwxr-xr-x | scripts/vyatta-interfaces.pl | 6 |
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 ); |