summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--link.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/link.c b/link.c
index 95f0816..eb3ba18 100644
--- a/link.c
+++ b/link.c
@@ -99,18 +99,9 @@ u32 ethtool_bitrate(const char *ifname)
goto out;
}
- switch (ecmd.speed) {
- case SPEED_10:
- case SPEED_100:
- case SPEED_1000:
- case SPEED_2500:
- case SPEED_10000:
- bitrate = ecmd.speed;
- break;
- default:
+ bitrate = ethtool_cmd_speed(&ecmd);
+ if (bitrate == SPEED_UNKNOWN)
bitrate = 0;
- break;
- };
out:
close(sock);