]> git.sur5r.net Git - i3/i3status/commitdiff
Merge pull request #334 from stapelberg/speed
authorIngo Bürk <admin@airblader.de>
Sun, 27 Jan 2019 21:40:46 +0000 (22:40 +0100)
committerGitHub <noreply@github.com>
Sun, 27 Jan 2019 21:40:46 +0000 (22:40 +0100)
fix ethernet speed display for 100 Gbit/s cards

src/print_eth_info.c

index f9e63dacd9b3504f4d612ac00451723bc529888e..81e74a798bbadb9467b3f539d4c8cdee069c9d1d 100644 (file)
@@ -43,7 +43,7 @@ static int print_eth_speed(char *outwalk, const char *interface) {
     ifr.ifr_data = (caddr_t)&ecmd;
     (void)strcpy(ifr.ifr_name, interface);
     if (ioctl(general_socket, SIOCETHTOOL, &ifr) == 0) {
-        ethspeed = (ecmd.speed == USHRT_MAX ? 0 : ecmd.speed);
+        ethspeed = (ecmd.speed == USHRT_MAX ? 0 : ethtool_cmd_speed(&ecmd));
         return sprintf(outwalk, "%d Mbit/s", ethspeed);
     } else
         return sprintf(outwalk, "?");