[ovs-dev] [PATCH 1/3] netdev-linux: Fix tap device stats.

Jesse Gross jesse at nicira.com
Tue Jun 1 16:17:38 PDT 2010


For tap and internal devices we swap the transmit and receive stats
to appear consistent with other devices.  However, the check whether
to store the stats in a temporary location before the swap did not
include tap devices, which lead to the use of uninitialized memory
when the swap occured.
---
 lib/netdev-linux.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 9a6d70a..42ca4a1 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -797,7 +797,7 @@ netdev_linux_get_stats(const struct netdev *netdev_,
     COVERAGE_INC(netdev_get_stats);
 
     netdev_linux_update_is_pseudo(netdev_dev);
-    if (netdev_dev->is_internal) {
+    if ((netdev_dev->is_internal || netdev_dev->is_tap)) {
         collect_stats = &raw_stats;
     }
 
-- 
1.7.0.4





More information about the dev mailing list