diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-03-17 11:28:36 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-03-17 11:28:36 -0700 |
commit | ba4639d5d1fd9c20d180d80f2a2fc95a8cde9494 (patch) | |
tree | 814e3ff65f1e500c43be32f39935e2da9b0b3b87 /scripts | |
parent | 47e3b415c8f3d4544ccc62755369985ca70d6c5f (diff) | |
download | vyatta-cfg-quagga-ba4639d5d1fd9c20d180d80f2a2fc95a8cde9494.tar.gz vyatta-cfg-quagga-ba4639d5d1fd9c20d180d80f2a2fc95a8cde9494.zip |
Handle devices that do not report ethtool
Some devices might not report ethtool settings, but still
allow ethtool configuration of speed/duplex.
Bug 5466
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vyatta-interfaces.pl | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl index 30ba30fa..cbb6abf6 100755 --- a/scripts/vyatta-interfaces.pl +++ b/scripts/vyatta-interfaces.pl @@ -576,16 +576,14 @@ sub set_speed_duplex { die "Missing --dev argument\n" unless $intf; my ($ospeed, $oduplex, $autoneg) = get_ethtool($intf); - unless ($ospeed) { - # Device does not support ethtool or does not report speed - die "Device $intf does not support setting speed/duplex\n" - unless ($nspeed eq 'auto'); - } elsif ($autoneg) { - # Device is in autonegotiation mode - return if ($nspeed eq 'auto'); - } else { - # Device has explicit speed/duplex - return if (($nspeed eq $ospeed) && ($nduplex eq $oduplex)); + if ($ospeed) { + if ($autoneg) { + # Device is in autonegotiation mode + return if ($nspeed eq 'auto'); + } else { + # Device has explicit speed/duplex but they already match + return if (($nspeed eq $ospeed) && ($nduplex eq $oduplex)); + } } my @cmd = ('sudo', 'ethtool', '-s', $intf ); |