summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2018-03-27 01:07:25 -0700
committerOle Trøan <otroan@employees.org>2018-03-28 07:05:12 +0000
commitae33579befd24b4126e6b9a3ea8538d1c5a30a7b (patch)
tree7fa2868823413864443e3d22e4f8bc950f9c9de9 /src/plugins
parentdd2f9865c1cb73a4d687941d52d220294f4a63d9 (diff)
NAT44: fix nat44_user_session_dump and nat44_del_session crash with one worker (VPP-1213)
Change-Id: I8e0c7ed2ff462b9ab59c233f56be262ec03c29ff Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/nat/nat.c2
-rw-r--r--src/plugins/nat/nat_api.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/nat/nat.c b/src/plugins/nat/nat.c
index acd167163c2..558d74b70d3 100644
--- a/src/plugins/nat/nat.c
+++ b/src/plugins/nat/nat.c
@@ -3714,7 +3714,7 @@ nat44_del_session (snat_main_t *sm, ip4_address_t *addr, u16 port,
snat_user_t *u;
ip.dst_address.as_u32 = ip.src_address.as_u32 = addr->as_u32;
- if (sm->num_workers)
+ if (sm->num_workers > 1)
tsm =
vec_elt_at_index (sm->per_thread_data,
sm->worker_in2out_cb (&ip, fib_index));
diff --git a/src/plugins/nat/nat_api.c b/src/plugins/nat/nat_api.c
index 2397663270a..6a497893e55 100644
--- a/src/plugins/nat/nat_api.c
+++ b/src/plugins/nat/nat_api.c
@@ -1161,7 +1161,7 @@ vl_api_nat44_user_session_dump_t_handler (vl_api_nat44_user_session_dump_t *
ip.src_address.as_u32 = ukey.addr.as_u32;
ukey.fib_index = fib_table_find (FIB_PROTOCOL_IP4, ntohl (mp->vrf_id));
key.key = ukey.as_u64;
- if (sm->num_workers)
+ if (sm->num_workers > 1)
tsm =
vec_elt_at_index (sm->per_thread_data,
sm->worker_in2out_cb (&ip, ukey.fib_index));