X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fnat%2Fout2in_ed.c;h=06e72f31a1b76c41f8c5bdc92f36b5a0e24cba7d;hb=e036d020d7e9ac9e55640ff3eb4507da02f76b9d;hp=41f9bfe262e7d76c23c01f39fc0c8a6f176b7d52;hpb=34931eb47124ef78a3aa9575930e848a78c9618b;p=vpp.git diff --git a/src/plugins/nat/out2in_ed.c b/src/plugins/nat/out2in_ed.c index 41f9bfe262e..06e72f31a1b 100644 --- a/src/plugins/nat/out2in_ed.c +++ b/src/plugins/nat/out2in_ed.c @@ -452,6 +452,8 @@ create_bypass_for_fwd (snat_main_t * sm, ip4_header_t * ip, u32 rx_fib_index, } else { + u32 proto; + if (PREDICT_FALSE (maximum_sessions_exceeded (sm, thread_index))) return; @@ -471,12 +473,19 @@ create_bypass_for_fwd (snat_main_t * sm, ip4_header_t * ip, u32 rx_fib_index, return; } + proto = ip_proto_to_snat_proto (key.proto); + s->ext_host_addr = key.r_addr; s->ext_host_port = key.r_port; s->flags |= SNAT_SESSION_FLAG_FWD_BYPASS; s->out2in.addr = key.l_addr; s->out2in.port = key.l_port; - s->out2in.protocol = ip_proto_to_snat_proto (key.proto); + s->out2in.protocol = proto; + if (proto == ~0) + { + s->flags |= SNAT_SESSION_FLAG_UNKNOWN_PROTO; + s->out2in.port = ip->protocol; + } s->out2in.fib_index = 0; s->in2out = s->out2in; user_session_increment (sm, u, 0);