summaryrefslogtreecommitdiff
path: root/trafgen_parser.y
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2016-12-16 12:02:06 +0100
committerTobias Klauser <tklauser@distanz.ch>2016-12-16 12:02:06 +0100
commit374141decf7c9978fd2c535099440d68e11e7683 (patch)
treee4319060aea90473e47488a04f09ea995a609d59 /trafgen_parser.y
parent074f8fc82ff26bb02c3c09f6ed71bca77e08e020 (diff)
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 <tklauser@distanz.ch>
Diffstat (limited to 'trafgen_parser.y')
-rw-r--r--trafgen_parser.y6
1 files 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)