Skip to content

Commit 2c67c31

Browse files
committed
fix last commit
1 parent 86a78b2 commit 2c67c31

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

network.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,8 @@ int send_raw_ip(raw_info_t &raw_info,const char * payload,int payloadlen)
568568

569569
if(raw_info.disabled)
570570
{
571+
mylog(log_debug,"[%s,%d]connection disabled, no packet will be sent\n",my_ntoa(recv_info.src_ip),recv_info.src_port);
572+
assert(max_rst_allowed>=0);
571573
return 0;
572574
}
573575

@@ -1451,6 +1453,7 @@ int recv_raw_tcp(raw_info_t &raw_info,char * &payload,int &payloadlen)
14511453
if(tcph->rst==1)
14521454
{
14531455
raw_info.rst_received++;
1456+
14541457
if(max_rst_to_show>0)
14551458
{
14561459
if(raw_info.rst_received < max_rst_to_show)
@@ -1459,14 +1462,14 @@ int recv_raw_tcp(raw_info_t &raw_info,char * &payload,int &payloadlen)
14591462
}
14601463
else if(raw_info.rst_received == max_rst_to_show)
14611464
{
1462-
mylog(log_warn,"[%s,%d]rst==1,cnt=%d >=max_rst_to_show, this log is muted for current connection\n",my_ntoa(recv_info.src_ip),recv_info.src_port,(int)raw_info.rst_received);
1465+
mylog(log_warn,"[%s,%d]rst==1,cnt=%d >=max_rst_to_show, this log will be muted for current connection\n",my_ntoa(recv_info.src_ip),recv_info.src_port,(int)raw_info.rst_received);
14631466
}
14641467
else
14651468
{
14661469
mylog(log_debug,"[%s,%d]rst==1,cnt=%d\n",my_ntoa(recv_info.src_ip),recv_info.src_port,(int)raw_info.rst_received);
14671470
}
14681471
}
1469-
if(max_rst_to_show==0)
1472+
else if(max_rst_to_show==0)
14701473
{
14711474
mylog(log_debug,"[%s,%d]rst==1,cnt=%d\n",my_ntoa(recv_info.src_ip),recv_info.src_port,(int)raw_info.rst_received);
14721475
}
@@ -1477,7 +1480,7 @@ int recv_raw_tcp(raw_info_t &raw_info,char * &payload,int &payloadlen)
14771480

14781481
if(max_rst_allowed>=0 && raw_info.rst_received==max_rst_allowed+1 )
14791482
{
1480-
mylog(log_warn,"[%s,%d]connection disabled because of rst_received %d > max_rst_allow=%d\n",my_ntoa(recv_info.src_ip),recv_info.src_port,(int)raw_info.rst_received,(int)max_rst_allowed );
1483+
mylog(log_warn,"[%s,%d]connection disabled because of rst_received=%d > max_rst_allow=%d\n",my_ntoa(recv_info.src_ip),recv_info.src_port,(int)raw_info.rst_received,(int)max_rst_allowed );
14811484
raw_info.disabled=1;
14821485
}
14831486
}

0 commit comments

Comments
 (0)