diff options
author | Filip Varga <fivarga@cisco.com> | 2020-02-25 14:31:33 +0100 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2020-03-13 11:17:13 +0000 |
commit | a73f2d6f53c224668bd6bbea1a980ee4313c794f (patch) | |
tree | c40965985639940beb294e8688aedbe30e47a548 /src/plugins/nat/nat_api.c | |
parent | c27b43673237c3971c1c170646b531728e0d8eb1 (diff) |
nat: timed out session scavenging upgrade
Patch changes the behavior of session scavenging and fixes multiple
nat issues. Allows proper session clearing and removes issue with lingering sessions
in session db. Patch also updates and fixes CLI/API calls for better readability
of session state metrics. Fixes security issue that would allow attacker to
reuse timed out session in both directions (in2out/out2in).
Type: improvement
Signed-off-by: Filip Varga <fivarga@cisco.com>
Change-Id: I78897585a2a57291fad5db6d457941aa0a0457bd
Diffstat (limited to 'src/plugins/nat/nat_api.c')
-rw-r--r-- | src/plugins/nat/nat_api.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/plugins/nat/nat_api.c b/src/plugins/nat/nat_api.c index d8c2c5fd1c9..a71c888b6c6 100644 --- a/src/plugins/nat/nat_api.c +++ b/src/plugins/nat/nat_api.c @@ -247,9 +247,7 @@ vl_api_nat44_session_cleanup_t_handler (vl_api_nat44_session_cleanup_t * mp) snat_main_t *sm = &snat_main; vl_api_nat44_session_cleanup_reply_t *rmp; int rv = 0; - - nat44_force_session_cleanup (); - + nat44_force_users_cleanup (); REPLY_MACRO (VL_API_NAT44_SESSION_CLEANUP_REPLY); } @@ -338,6 +336,8 @@ vl_api_nat_set_timeouts_t_handler (vl_api_nat_set_timeouts_t * mp) sm->tcp_transitory_timeout = ntohl (mp->tcp_transitory); sm->icmp_timeout = ntohl (mp->icmp); + sm->min_timeout = nat44_minimal_timeout (sm); + rv = nat64_set_icmp_timeout (ntohl (mp->icmp)); if (rv) goto send_reply; @@ -747,10 +747,8 @@ vl_api_nat44_del_user_t_handler (vl_api_nat44_del_user_t * mp) vl_api_nat44_del_user_reply_t *rmp; ip4_address_t addr; int rv; - memcpy (&addr.as_u8, mp->ip_address, 4); rv = nat44_user_del (&addr, ntohl (mp->fib_index)); - REPLY_MACRO (VL_API_NAT44_DEL_USER_REPLY); } |