aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/nat/nat.c')
-rwxr-xr-xsrc/plugins/nat/nat.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/plugins/nat/nat.c b/src/plugins/nat/nat.c
index 97e2df1568e..249df38a3b5 100755
--- a/src/plugins/nat/nat.c
+++ b/src/plugins/nat/nat.c
@@ -188,11 +188,20 @@ nat_free_session_data (snat_main_t * sm, snat_session_t * s, u32 thread_index,
if (is_fwd_bypass_session (s))
{
+ if (snat_is_unk_proto_session (s))
+ {
+ ed_key.proto = s->in2out.port;
+ ed_key.r_port = 0;
+ ed_key.l_port = 0;
+ }
+ else
+ {
+ ed_key.proto = snat_proto_to_ip_proto (s->in2out.protocol);
+ ed_key.l_port = s->in2out.port;
+ ed_key.r_port = s->ext_host_port;
+ }
ed_key.l_addr = s->in2out.addr;
ed_key.r_addr = s->ext_host_addr;
- ed_key.l_port = s->in2out.port;
- ed_key.r_port = s->ext_host_port;
- ed_key.proto = snat_proto_to_ip_proto (s->in2out.protocol);
ed_key.fib_index = 0;
ed_kv.key[0] = ed_key.as_u64[0];
ed_kv.key[1] = ed_key.as_u64[1];