From 7d14b84ee8eaef5270ca91c875e7981d45c6feff Mon Sep 17 00:00:00 2001 From: yangwei Date: Fri, 15 Mar 2024 12:04:52 +0800 Subject: 🐞 fix(ctrl pkt process): 设置stream_drop仍然上送控制报文 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dealpkt/deal_tcp.c | 4 ++-- src/dealpkt/deal_udp.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dealpkt/deal_tcp.c b/src/dealpkt/deal_tcp.c index 3467309..f4b4964 100644 --- a/src/dealpkt/deal_tcp.c +++ b/src/dealpkt/deal_tcp.c @@ -2929,7 +2929,7 @@ static int deal_tcp_stream(struct streamindex *pindex, const void *this_iphdr, s /* 2014-10-11 lijia add, Fdƽ̨ʵ */ - if(unlikely(pstream_pr->stream_killed_flag != 0)){ + if(unlikely(pstream_pr->stream_killed_flag != 0) && raw_pkt->is_ctrl_pkt==0){ if((pdetail_pr->auto_remedy_flag != 0) && (tcplen > 0)){ /* ֹflood, ֻдݵİŷRST */ sapp_runtime_log(RLOG_LV_DEBUG, "TCP stream: %s, kill_tcp remedy, curdir:%d, send RST pkt.", printaddr(&pstream->addr, pstream->threadnum), pstream->curdir); @@ -2961,7 +2961,7 @@ static int deal_tcp_stream(struct streamindex *pindex, const void *this_iphdr, s return PASS; } - if(unlikely(pdetail_pr->drop_stream_flag != 0) ){ + if(unlikely(pdetail_pr->drop_stream_flag != 0) && raw_pkt->is_ctrl_pkt==0){ sapp_runtime_log(RLOG_LV_DEBUG, "TCP stream: %s, has been set drop flag, curdir:%d, return DROP.", printaddr(&pstream->addr, pstream->threadnum), pstream->curdir); pdetail->lastmtime = g_CurrentTime; diff --git a/src/dealpkt/deal_udp.c b/src/dealpkt/deal_udp.c index b86a82c..7b4066d 100644 --- a/src/dealpkt/deal_udp.c +++ b/src/dealpkt/deal_udp.c @@ -708,11 +708,11 @@ int dealipv4udppkt(struct streamindex *pindex, const struct mesa_ip4_hdr * this_ } /* 2014-11-15 lijia add, for udp serial kill udp */ - if(unlikely(a_index->stream.stream_killed_flag != 0)){ + if(unlikely(a_index->stream.stream_killed_flag != 0 && raw_pkt->is_ctrl_pkt==0)){ return DROP; } - if(unlikely(pdetail_pr->drop_stream_flag != 0)){ /* 2020-06-02 lijia add */ + if(unlikely(pdetail_pr->drop_stream_flag != 0) && raw_pkt->is_ctrl_pkt==0 ){ /* 2020-06-02 lijia add */ return DROP; } @@ -998,11 +998,11 @@ int dealipv6udppkt(struct streamindex *pindex,const struct mesa_ip6_hdr *a_packe } /* 2014-11-15 lijia add, for udp serial kill udp */ - if(unlikely(a_index->stream.stream_killed_flag != 0)){ + if(unlikely(a_index->stream.stream_killed_flag != 0) && raw_pkt->is_ctrl_pkt==0){ return DROP; } - if(unlikely(pdetail_pr->drop_stream_flag != 0)){ /* 2020-06-02 lijia add */ + if(unlikely(pdetail_pr->drop_stream_flag != 0) && raw_pkt->is_ctrl_pkt==0){ /* 2020-06-02 lijia add */ return DROP; } -- cgit v1.2.3