From 6ff8790c92e36120d08f7be2052075f25506e16a Mon Sep 17 00:00:00 2001 From: Matus Fabian Date: Fri, 16 Nov 2018 04:41:31 -0800 Subject: NAT44: fix bug in TCP close with output-feature interface (VPP-1493) Change-Id: If8c883d6b1ee58de9a03012d3567ec82211a0225 Signed-off-by: Matus Fabian (cherry picked from commit 6c01dceea5c612373453db7f1ccda589a2cd782e) --- src/plugins/nat/nat.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/plugins/nat/nat.h') diff --git a/src/plugins/nat/nat.h b/src/plugins/nat/nat.h index 13467203917..02d4aaef9f6 100644 --- a/src/plugins/nat/nat.h +++ b/src/plugins/nat/nat.h @@ -174,6 +174,7 @@ typedef enum #define SNAT_SESSION_FLAG_ENDPOINT_DEPENDENT 16 #define SNAT_SESSION_FLAG_FWD_BYPASS 32 #define SNAT_SESSION_FLAG_AFFINITY 64 +#define SNAT_SESSION_FLAG_OUTPUT_FEATURE 128 /* NAT interface flags */ #define NAT_INTERFACE_FLAG_IS_INSIDE 1 @@ -673,6 +674,12 @@ unformat_function_t unformat_snat_protocol; */ #define is_lb_static_mapping(sm) (sm->flags & NAT_STATIC_MAPPING_FLAG_LB) +/** \brief Check if client initiating TCP connection (received SYN from client) + @param t TCP header + @return 1 if client initiating TCP connection +*/ +#define tcp_is_init(t) ((t->flags & TCP_FLAG_SYN) && !(t->flags & TCP_FLAG_ACK)) + /* logging */ #define nat_log_err(...) \ vlib_log(VLIB_LOG_LEVEL_ERR, snat_main.log_class, __VA_ARGS__) -- cgit 1.2.3-korg