diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2013-05-29 13:06:22 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2013-05-29 13:06:22 +0200 |
commit | e9cb93501216c891347481a032ac058cc3deea2b (patch) | |
tree | fe37fe1e5992cad9488efe9a2c35a9545b400c72 | |
parent | f6c99a52f7714cae8cd048d758086e213e163571 (diff) |
ifpps: Properly zero out allocated stats
The dynamically allocated members of struct ifstat have an entry for
each CPU. Properly consider this when resetting the stats in the
STATS_ZERO1 macro.
Reported-by: Daniel Borkmann <borkmann@iogearbox.net>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r-- | ifpps.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -164,7 +164,7 @@ static void stats_alloc(struct ifstat *stats, int cpus) } #define STATS_ZERO1(member) \ - do { memset(stats->member, 0, sizeof(*(stats->member))); } while (0) + do { memset(stats->member, 0, cpus * sizeof(*(stats->member))); } while (0) static void stats_zero(struct ifstat *stats, int cpus) { |