diff options
author | Juraj Sloboda <jsloboda@cisco.com> | 2017-04-03 08:49:47 +0200 |
---|---|---|
committer | Juraj Sloboda <jsloboda@cisco.com> | 2017-04-12 13:55:14 +0200 |
commit | f3ebb452ca26318b75b8f93569c3c752f05aed25 (patch) | |
tree | ef614d9df2013da1ab307b276014a10ad7024a98 /src/plugins/snat/in2out.c | |
parent | d89b60491c336172ad07bbcd55bf0ca4fab3d16a (diff) |
Support ICMP session timeout in deterministic NAT
Change-Id: I0306bc0ab87908adb79c594c657d579cb34b3ec1
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
Diffstat (limited to 'src/plugins/snat/in2out.c')
-rw-r--r-- | src/plugins/snat/in2out.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/snat/in2out.c b/src/plugins/snat/in2out.c index 89054a01b64..2dbaeb40355 100644 --- a/src/plugins/snat/in2out.c +++ b/src/plugins/snat/in2out.c @@ -2215,6 +2215,11 @@ u32 icmp_match_in2out_det(snat_main_t *sm, vlib_node_runtime_t *node, goto out; } + u32 now = (u32) vlib_time_now (sm->vlib_main); + + ses0->state = SNAT_SESSION_ICMP_ACTIVE; + ses0->expire = now + SNAT_ICMP_TIMEOUT; + out: *p_proto = protocol; if (ses0) |