summaryrefslogtreecommitdiff
path: root/scripts/vyatta-interfaces.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/vyatta-interfaces.pl')
-rwxr-xr-xscripts/vyatta-interfaces.pl15
1 files changed, 7 insertions, 8 deletions
diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl
index c209abbe..e15e0ce7 100755
--- a/scripts/vyatta-interfaces.pl
+++ b/scripts/vyatta-interfaces.pl
@@ -451,14 +451,13 @@ sub set_speed_duplex {
# read old values to avoid meaningless speed changes
my ($autoneg, $ospeed, $oduplex) = get_ethtool($intf);
- if (defined($autoneg)) {
- if ($autoneg == 1) {
- # Device is already 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));
- }
+
+ if (defined($autoneg) && $autoneg == 1) {
+ # Device is already in autonegotiation mode
+ return if ($nspeed eq 'auto');
+ } elsif (defined($ospeed) && defined($oduplex)) {
+ # Device has explicit speed/duplex but they already match
+ return if (($nspeed eq $ospeed) && ($nduplex eq $oduplex));
}
my $cmd = "$ETHTOOL -s $intf";