summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-08-15 23:34:10 +0200
committerThomas Haller <thaller@redhat.com>2016-08-17 16:08:21 +0200
commit36f8ffad9f8eee4132eed92497f4facca2e03519 (patch)
treecd934ba4f98679876c6661f96ed4c54ebcd24b13
parentfc2f1d9cb87a0df904e1f7ff0aaac5d8b9d807d2 (diff)
downloadNetworkManager-36f8ffad9f8eee4132eed92497f4facca2e03519.tar.gz
device: refresh the link before reading the stats
-rw-r--r--src/devices/nm-device-statistics.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/devices/nm-device-statistics.c b/src/devices/nm-device-statistics.c
index 12e595c941..4b2bbdd08b 100644
--- a/src/devices/nm-device-statistics.c
+++ b/src/devices/nm-device-statistics.c
@@ -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;
}