fix miscalculation of NIC speed On Linux, when nicstat obtains nic info via ioctl SIOCETHTOOL, it picks up the speed from a struct ethtool_cmd, where it's stored as a u16 in Mbps, and multiplies it by the integer literal 1000000 to get bps. . On 10GbE ethernet this causes a signed integer overflow, which is undefined behaviour and the result sadly never seems to work out to the correct 10,000,000,000 bps :-)
Fix utilization calculation by using correct constant for full duplex on Linux The code that calculates utilization checks the duplex mode against a numeric value (`2') that (apparently) is the value of DUPLEX_FULL on Solaris. . On Linux, DUPLEX_FULL has a different value and so nicstat will always treat full duplex cards as half duplex and get the utilisation wrong; hence the increased severity.