Merge pull request #334 from stapelberg/speed
fix ethernet speed display for 100 Gbit/s cards
This commit is contained in:
commit
1f3fe73b36
@ -43,7 +43,7 @@ static int print_eth_speed(char *outwalk, const char *interface) {
|
|||||||
ifr.ifr_data = (caddr_t)&ecmd;
|
ifr.ifr_data = (caddr_t)&ecmd;
|
||||||
(void)strcpy(ifr.ifr_name, interface);
|
(void)strcpy(ifr.ifr_name, interface);
|
||||||
if (ioctl(general_socket, SIOCETHTOOL, &ifr) == 0) {
|
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);
|
return sprintf(outwalk, "%d Mbit/s", ethspeed);
|
||||||
} else
|
} else
|
||||||
return sprintf(outwalk, "?");
|
return sprintf(outwalk, "?");
|
||||||
|
Loading…
Reference in New Issue
Block a user