device: refresh the link before reading the stats

This commit is contained in:
Thomas Haller 2016-08-15 23:34:10 +02:00
parent fc2f1d9cb8
commit 36f8ffad9f

View file

@ -47,6 +47,8 @@ update_stats (gpointer user_data)
ifindex = nm_device_get_ip_ifindex (self->device);
nm_platform_link_refresh (NM_PLATFORM_GET, ifindex);
pllink = nm_platform_link_get (NM_PLATFORM_GET, ifindex);
if (pllink) {
_LOGT ("ifindex %d: {RX} %"PRIu64" packets %"PRIu64" bytes {TX} %"PRIu64" packets %"PRIu64" bytes",
@ -60,9 +62,6 @@ update_stats (gpointer user_data)
nm_device_set_rx_bytes (self->device, 0);
}
/* Keep polling */
nm_platform_link_refresh (NM_PLATFORM_GET, ifindex);
return TRUE;
}