aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/in2out_ed.c
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2020-06-22 12:52:29 +0000
committerKlement Sekera <ksekera@cisco.com>2020-06-22 12:58:00 +0000
commit1523c347d8f9e2a628d733e97f76d39b879861f0 (patch)
tree24bd9381526b71e29cbc35965dee575b8ef6ebc9 /src/plugins/nat/in2out_ed.c
parent4128c7b463d44b589a3443e3058d40cad037e11b (diff)
nat: set buf error if can't create user
Type: fix Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: I747d78966a7296dcbae54d54b0c165d407c8863d
Diffstat (limited to 'src/plugins/nat/in2out_ed.c')
-rw-r--r--src/plugins/nat/in2out_ed.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/plugins/nat/in2out_ed.c b/src/plugins/nat/in2out_ed.c
index 19b128864f0..e5f29e4b445 100644
--- a/src/plugins/nat/in2out_ed.c
+++ b/src/plugins/nat/in2out_ed.c
@@ -368,12 +368,7 @@ slow_path_ed (snat_main_t * sm,
&sm_fib_index, 0, 0, 0, &lb, 0, &identity_nat))
{
s = nat_ed_session_alloc (sm, thread_index, now, proto);
- if (!s)
- {
- nat_elog_warn ("create NAT session failed");
- b->error = node->errors[NAT_IN2OUT_ED_ERROR_MAX_USER_SESS_EXCEEDED];
- return NAT_NEXT_DROP;
- }
+ ASSERT (s);
s->in2out.addr = l_addr;
s->in2out.port = l_port;
s->nat_proto = nat_proto;
@@ -418,12 +413,7 @@ slow_path_ed (snat_main_t * sm,
return next;
}
s = nat_ed_session_alloc (sm, thread_index, now, proto);
- if (!s)
- {
- nat_elog_warn ("create NAT session failed");
- b->error = node->errors[NAT_IN2OUT_ED_ERROR_MAX_USER_SESS_EXCEEDED];
- return NAT_NEXT_DROP;
- }
+ ASSERT (s);
s->out2in.addr = sm_addr;
s->out2in.port = sm_port;
s->in2out.addr = l_addr;
@@ -863,7 +853,7 @@ nat44_ed_in2out_unknown_proto (snat_main_t * sm,
s = nat_ed_session_alloc (sm, thread_index, now, ip->protocol);
if (!s)
{
- b->error = node->errors[NAT_IN2OUT_ED_ERROR_MAX_USER_SESS_EXCEEDED];
+ b->error = node->errors[NAT_IN2OUT_ED_ERROR_MAX_SESSIONS_EXCEEDED];
nat_elog_warn ("create NAT session failed");
return 0;
}