ntp: add debug message to update of link speed

This commit is contained in:
Miroslav Lichvar 2018-03-14 13:25:18 +01:00
parent 78a6698ae1
commit b827475378

View file

@ -273,7 +273,7 @@ update_interface_speed(struct Interface *iface)
{
struct ethtool_cmd cmd;
struct ifreq req;
int sock_fd;
int sock_fd, link_speed;
sock_fd = socket(AF_INET, SOCK_DGRAM, 0);
if (sock_fd < 0)
@ -294,7 +294,12 @@ update_interface_speed(struct Interface *iface)
close(sock_fd);
iface->link_speed = ethtool_cmd_speed(&cmd);
link_speed = ethtool_cmd_speed(&cmd);
if (iface->link_speed != link_speed) {
iface->link_speed = link_speed;
DEBUG_LOG("Updated speed of %s to %d Mb/s", iface->name, link_speed);
}
}
/* ================================================== */