nat: initialize fq_in2out_output_index 25/18625/4
authorMatthew Smith <mgsmith@netgate.com>
Mon, 1 Apr 2019 21:27:00 +0000 (16:27 -0500)
committerOle Trøan <otroan@employees.org>
Tue, 9 Apr 2019 10:47:26 +0000 (10:47 +0000)
When using the output feature ('postrouting') outbound translation,
no packets are passed when using worker threads. The frame queue for
in2out packets to be handed off between threads is never allocated.
This is because that allocation only happens if the value of
fq_in2out_output_index == ~0, but fq_in2out_output_index is never
initialized prior to checking that.

Initialize fq_in2out_output_index to ~0 so a frame queue will be
allocated when there are worker threads.

Change-Id: I0836685eb611348643c11ac7e4d0cab935a29384
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
src/plugins/nat/nat.c

index 3856add..43ef325 100755 (executable)
@@ -2269,6 +2269,7 @@ snat_init (vlib_main_t * vm)
   sm->workers = 0;
   sm->port_per_thread = 0xffff - 1024;
   sm->fq_in2out_index = ~0;
+  sm->fq_in2out_output_index = ~0;
   sm->fq_out2in_index = ~0;
   sm->udp_timeout = SNAT_UDP_TIMEOUT;
   sm->tcp_established_timeout = SNAT_TCP_ESTABLISHED_TIMEOUT;