recv SYN after FIN or RST is considered to be TCP port reuse

This commit is contained in:
luwenpeng
2024-05-17 17:38:08 +08:00
parent 32ae4618ef
commit c22e4e5955
5 changed files with 36 additions and 19 deletions

View File

@@ -658,7 +658,8 @@ static struct session *session_manager_lookup_tcp_session(struct session_manager
enum flow_direction dir = identify_direction_by_history(sess, key);
struct tcp_half *half = &sess->tcp_halfs[dir];
if (half->isn && half->isn != tcp_hdr_get_seq(hdr))
if ((half->isn && half->isn != tcp_hdr_get_seq(hdr)) || // recv SYN with different ISN
((half->history & TH_FIN) || (half->history & TH_RST))) // recv SYN after FIN or RST
{
// TCP port reuse, evict old session
session_manager_evicte_session(mgr, sess, now, PORT_REUSE_EVICT);