From 36f8ffad9f8eee4132eed92497f4facca2e03519 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 15 Aug 2016 23:34:10 +0200 Subject: [PATCH] device: refresh the link before reading the stats --- src/devices/nm-device-statistics.c | 5 ++--- 1 file 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; }