nfq: clear memory of queue before using it

Avoids using uninitialized memory. Show showed itself
in nonsense values in counters, and in nfq_handle_packet
errors that were likely the result of passing uninitialized
memory to the nfq API.

Bug 3263.
Bug 3120.

Fixes: b2a6c60dee ("source-nfq: increase maximum queues number to 65535")
pull/4321/head
Victor Julien 6 years ago
parent 2fd1174a56
commit 64a789bbf6

@ -847,6 +847,7 @@ int NFQRegisterQueue(const uint16_t number)
ntv->nfq_index = receive_queue_num;
nq = &g_nfq_q[receive_queue_num];
memset(nq, 0, sizeof(*nq));
nq->queue_num = number;
receive_queue_num++;
SCMutexUnlock(&nfq_init_lock);

Loading…
Cancel
Save