mirror of
https://github.com/wangyu-/udp2raw.git
synced 2025-01-19 14:29:34 +08:00
--fix-gro works
This commit is contained in:
parent
7e55b1e132
commit
c1dfd4e928
@ -653,14 +653,14 @@ int recv_safer_multi(conn_info_t &conn_info,vector<char> &type_arr,vector<string
|
|||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
char *ori_recv_data=recv_data;
|
char *ori_recv_data=recv_data;
|
||||||
mylog(log_debug,"recv_len:%d\n",recv_len);
|
//mylog(log_debug,"recv_len:%d\n",recv_len);
|
||||||
while(recv_len>2)
|
while(recv_len>2)
|
||||||
{
|
{
|
||||||
recv_len-=2;
|
|
||||||
int single_len;
|
int single_len;
|
||||||
//recv_data[0]^=gro_xor[0];
|
//recv_data[0]^=gro_xor[0];
|
||||||
//recv_data[1]^=gro_xor[1];
|
//recv_data[1]^=gro_xor[1];
|
||||||
single_len=read_u16(recv_data);
|
single_len=read_u16(recv_data);
|
||||||
|
recv_len-=2;
|
||||||
recv_data+=2;
|
recv_data+=2;
|
||||||
if(single_len > recv_len)
|
if(single_len > recv_len)
|
||||||
{
|
{
|
||||||
@ -676,14 +676,14 @@ int recv_safer_multi(conn_info_t &conn_info,vector<char> &type_arr,vector<string
|
|||||||
|
|
||||||
if(ret!=0)
|
if(ret!=0)
|
||||||
{
|
{
|
||||||
mylog(log_debug,"parse failed, offset= %d,single_len=%d\n",ori_recv_data-recv_data,single_len);
|
mylog(log_debug,"parse failed, offset= %d,single_len=%d\n",recv_data-ori_recv_data,single_len);
|
||||||
} else{
|
} else{
|
||||||
type_arr.push_back(type);
|
type_arr.push_back(type);
|
||||||
data_arr.emplace_back(data,data+len);
|
data_arr.emplace_back(data,data+len);
|
||||||
//std::copy(data,data+len,data_arr[data_arr.size()-1]);
|
//std::copy(data,data+len,data_arr[data_arr.size()-1]);
|
||||||
}
|
}
|
||||||
recv_data+=single_len;
|
recv_data+=single_len;
|
||||||
|
recv_len-=single_len;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1944,9 +1944,8 @@ int recv_raw_tcp(raw_info_t &raw_info,char * &payload,int &payloadlen)
|
|||||||
|
|
||||||
if(tcp_chk!=0)
|
if(tcp_chk!=0)
|
||||||
{
|
{
|
||||||
mylog(log_debug,"tcp_chk:%x\n",tcp_chk);
|
mylog(log_debug,"tcp_chk:%x, tcp checksum failed, ignored\n",tcp_chk);
|
||||||
mylog(log_debug,"tcp header error\n");
|
//return -1;
|
||||||
return -1;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user