summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlijia <[email protected]>2021-08-24 10:57:01 +0800
committerlijia <[email protected]>2021-08-24 10:57:01 +0800
commit1c4b0a6b12db8c2cfd2763c15e4b0554fdba6df7 (patch)
tree249a17e3148e14f6eafc6379fbc4fd23c26f2888
parent4230d2b6f0fde20fefcc316b740209763b3d9577 (diff)
TSG-7528, 修复第一个带负载的包就是乱序包, 且无TCP插件的情况下, TCPALL插件获取原始包选项错误.v4.2.49
-rw-r--r--src/dealpkt/deal_tcp.c18
-rw-r--r--src/dealpkt/plug_support.c2
2 files changed, 13 insertions, 7 deletions
diff --git a/src/dealpkt/deal_tcp.c b/src/dealpkt/deal_tcp.c
index b4dc55a..7f92833 100644
--- a/src/dealpkt/deal_tcp.c
+++ b/src/dealpkt/deal_tcp.c
@@ -2026,10 +2026,15 @@ static int tcp_deal_unorder(struct streamindex *pindex,struct streaminfo *a_tcp,
{
if(a_tcp->opstate== OP_STATE_CLOSE)
{
- return PASS;
+ ret = PASS;
+ goto done;
}
- if ((after (pakiet->seq, EXP_SEQ)) && (orderflag==CHECK_ORDER_DATA))
- break;
+
+ if ((after (pakiet->seq, EXP_SEQ)) && (orderflag==CHECK_ORDER_DATA)){
+ ret = PASS;
+ goto done;
+ }
+
if (after (pakiet->seq + pakiet->tcpdatalen+pakiet->fin+pakiet->rst, EXP_SEQ))
{
/* 2015-01-13 lijia add, ��������������kill_tcp��inject��غ���, ��Ҫ����ԭʼ����Ϣ */
@@ -2057,7 +2062,8 @@ static int tcp_deal_unorder(struct streamindex *pindex,struct streaminfo *a_tcp,
if(STREAM_LINK_DATA == last_link_state){
tcp_update_should_close_reason_stat(a_tcp->threadnum);
tcp_change_stream_tonouse(pindex);
- return DROP;
+ ret = DROP;
+ goto done;
}
/* ��Ϊ������update_stream_list_raw_pkt_pointer, �˴����ܷ���, �Ȼָ�ԭʼ��ָ�� */
ret = PASS;
@@ -2348,7 +2354,7 @@ static int tcp_deal_data_stream(struct streamindex *pindex,const void *this_iphd
}
//�����rst���ģ��������δ�������ᶪ���������Ѿ����������������
}
- assert(rcv->count >= 0);
+
//���Ӹ���
if (th_flags & TH_SYN)
{
@@ -2426,7 +2432,7 @@ static int tcp_deal_data_stream(struct streamindex *pindex,const void *this_iphd
return ret;
}
}
- assert(rcv->count >= 0);
+
if(pstream->dir==DIR_DOUBLE)
{
//if((snd->finstate ==FIN_CONFIRMED)&&(rcv->finstate ==FIN_CONFIRMED))
diff --git a/src/dealpkt/plug_support.c b/src/dealpkt/plug_support.c
index 4340113..31853b1 100644
--- a/src/dealpkt/plug_support.c
+++ b/src/dealpkt/plug_support.c
@@ -172,7 +172,7 @@ static const struct streaminfo_private *offset_to_vxlan_layer(const struct strea
static int get_vxlan_info_from_streaminfo(const struct streaminfo_private *pstream_pr, int type, void *void_value)
{
- int ret;
+ int ret = 0;
const struct streaminfo_private *vxlan_pstream_pr;
const raw_pkt_t *rawpkt;
const inline_vxlan_hdr_t *p_vxlan_hdr;