From 374141decf7c9978fd2c535099440d68e11e7683 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 16 Dec 2016 12:02:06 +0100 Subject: trafgen: proto: Zero out the correct packet slot In the third attempt, finally do the packet slot zeroing correctly. Zero the struct packet in __init_new_packet_slot() not the struct packet_dyn in __init_new_counter_slot(). Don't know what hit me yesterday... Fixes: d6d511ecff24 ("trafgen: proto: Zero out newly allocated struct packet") Signed-off-by: Tobias Klauser --- trafgen_parser.y | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trafgen_parser.y b/trafgen_parser.y index add8698..1e20cff 100644 --- a/trafgen_parser.y +++ b/trafgen_parser.y @@ -111,13 +111,13 @@ static inline int test_ignore(void) static inline void __init_new_packet_slot(struct packet *slot) { - slot->payload = NULL; - slot->len = 0; + memset(slot, 0, sizeof(*slot)); } static inline void __init_new_counter_slot(struct packet_dyn *slot) { - memset(slot, 0, sizeof(*slot)); + slot->cnt = NULL; + slot->clen = 0; } static inline void __init_new_randomizer_slot(struct packet_dyn *slot) -- cgit v1.2.3-54-g00ecf