summaryrefslogtreecommitdiff
path: root/scripts/vyatta-interfaces.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/vyatta-interfaces.pl')
-rwxr-xr-xscripts/vyatta-interfaces.pl18
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 );