diff options
| author | 杨威 <[email protected]> | 2022-12-01 16:42:12 +0800 |
|---|---|---|
| committer | 杨威 <[email protected]> | 2022-12-01 16:42:12 +0800 |
| commit | 566655a640c3b573f320f748099e1e7c4c7cf08e (patch) | |
| tree | e1d2146f7cd0a301cbb4565e7aecf9184a6b6fd8 | |
| parent | 248c51b5b3d35a8b2e1c6043a840907dd237e495 (diff) | |
✨ feat(bypass): well known port创建流不触发bypassv4.2.91
| -rw-r--r-- | src/dealpkt/deal_tcp.c | 28 | ||||
| -rw-r--r-- | src/dealpkt/stream_manage.c | 5 |
2 files changed, 21 insertions, 12 deletions
diff --git a/src/dealpkt/deal_tcp.c b/src/dealpkt/deal_tcp.c index bdb45c0..030478e 100644 --- a/src/dealpkt/deal_tcp.c +++ b/src/dealpkt/deal_tcp.c @@ -746,7 +746,10 @@ static struct streamindex *tcp_add_new_stream_bysyn(struct streamindex *pindex, pstream_pr->stream_create_timestamp_ms=sapp_global_val->individual_volatile->current_time_ms; /* ��������, �����ж�һ��ddos ״̬ */ - pstream_pr->under_ddos_bypass = packet_io_under_ddos_should_bypass(threadnum); + if(pstream_pr->create_dir_by_well_known_port != 1) + { + pstream_pr->under_ddos_bypass = packet_io_under_ddos_should_bypass(threadnum); + } } /* 2014-07-31 LiJia add, for set one stream unorder number */ @@ -963,7 +966,10 @@ static struct streamindex *tcp_add_new_stream_bydata(struct streamindex *pindex, pindex_tcp->stream.global_stream_id = get_global_stream_id(threadnum); /* ���Ӹ���, �����ж�һ��ddos ״̬ */ - pstream_pr->under_ddos_bypass = packet_io_under_ddos_should_bypass(threadnum); + if(pstream_pr->create_dir_by_well_known_port != 1) + { + pstream_pr->under_ddos_bypass = packet_io_under_ddos_should_bypass(threadnum); + } } pstream->dir=createdir; @@ -1003,15 +1009,15 @@ static struct streamindex *tcp_add_new_stream_bydata(struct streamindex *pindex, pstream_pr->timeout=link_default_nopkt_time; pdetail_pr->creat_mod=TCP_CTEAT_LINK_BYDATA; pstream->opstate=OP_STATE_PENDING; - if(tcp_support_all==TCP_SUPPORT_ENTRYALL_OFF) //by lqy 20141213 - { - pstream->pktstate=OP_STATE_CLOSE; - } - else - { - pstream->pktstate=OP_STATE_PENDING; - } - pdetail->createtime=g_CurrentTime; + if (tcp_support_all == TCP_SUPPORT_ENTRYALL_OFF) // by lqy 20141213 + { + pstream->pktstate = OP_STATE_CLOSE; + } + else + { + pstream->pktstate = OP_STATE_PENDING; + } + pdetail->createtime=g_CurrentTime; pdetail->lastmtime=g_CurrentTime; pstream_pr->stream_create_timestamp_ms=sapp_global_val->individual_volatile->current_time_ms; pstream_pr->stream_lastupdate_timestamp_ms=sapp_global_val->individual_volatile->current_time_ms; diff --git a/src/dealpkt/stream_manage.c b/src/dealpkt/stream_manage.c index e317746..2d0d1be 100644 --- a/src/dealpkt/stream_manage.c +++ b/src/dealpkt/stream_manage.c @@ -1461,7 +1461,10 @@ void hash_add_stream(struct streamindex *pindex) /* TCP, UDP�½���ʱ������ô˺���, ����ddos���ŵ��˴�, �����мDz�Ҫ�ŵ�streamaddlist()����, ��Ϊͬһ�����л���ͬ״̬ʱ, ���ܻ����streamaddlist()�ü���. */ - pindex->stream.under_ddos_bypass = packet_io_under_ddos_should_bypass(threadnum); + if(pindex->stream.create_dir_by_well_known_port != 1) + { + pindex->stream.under_ddos_bypass = packet_io_under_ddos_should_bypass(threadnum); + } pindex->stream.global_stream_id = get_global_stream_id(threadnum); } |
