修复错误丢弃重复流量包的bug
This commit is contained in:
@@ -1114,7 +1114,7 @@ static int dabloom_add(struct pkt_info *pktinfo, int thread_seq){
|
||||
return ret;
|
||||
}
|
||||
|
||||
void next_data_intercept(struct pme_info *pmeinfo, const void *a_packet, struct pkt_info *pktinfo, int thread_seq){
|
||||
char next_data_intercept(struct pme_info *pmeinfo, const void *a_packet, struct pkt_info *pktinfo, int thread_seq){
|
||||
FS_operate(g_kni_fs_handle->handle, g_kni_fs_handle->fields[KNI_FIELD_INTCP_READY_BYTE], 0, FS_OP_ADD, pktinfo->ip_totlen);
|
||||
int ret, len;
|
||||
void *logger = g_kni_handle->local_logger;
|
||||
@@ -1122,7 +1122,7 @@ void next_data_intercept(struct pme_info *pmeinfo, const void *a_packet, struct
|
||||
struct ip6_hdr* ipv6_hdr = NULL;
|
||||
if(pktinfo->parse_failed == 1){
|
||||
KNI_LOG_ERROR(logger, "next_data_intercept: invalid ip header, drop pkt and not send to tfe");
|
||||
return;
|
||||
return APP_STATE_DROPPKT | APP_STATE_KILL_OTHER | APP_STATE_GIVEME;
|
||||
}
|
||||
//search dabloom
|
||||
if(g_kni_handle->dup_traffic_switch == 1){
|
||||
@@ -1130,7 +1130,7 @@ void next_data_intercept(struct pme_info *pmeinfo, const void *a_packet, struct
|
||||
//ret = 1, = dup packet, bypass the packet
|
||||
ret = dabloom_search(pktinfo, thread_seq);
|
||||
if(ret == 1){
|
||||
return;
|
||||
return APP_STATE_FAWPKT | APP_STATE_KILL_OTHER | APP_STATE_GIVEME;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1145,7 +1145,7 @@ void next_data_intercept(struct pme_info *pmeinfo, const void *a_packet, struct
|
||||
if(pktinfo->ip_totlen > KNI_DEFAULT_MTU){
|
||||
KNI_LOG_DEBUG(logger, "Next data packet exceed MTU(1500), stream traceid = %s, stream addr = %s",
|
||||
pmeinfo->stream_traceid, pmeinfo->stream_addr);
|
||||
return;
|
||||
return APP_STATE_DROPPKT | APP_STATE_KILL_OTHER | APP_STATE_GIVEME;
|
||||
}
|
||||
ret = send_to_tfe((char*)a_packet, len, thread_seq, pmeinfo->tfe_id, pmeinfo->addr_type);
|
||||
if(ret < 0){
|
||||
@@ -1156,6 +1156,7 @@ void next_data_intercept(struct pme_info *pmeinfo, const void *a_packet, struct
|
||||
else{
|
||||
FS_operate(g_kni_fs_handle->handle, g_kni_fs_handle->fields[KNI_FIELD_INTCP_BYTE], 0, FS_OP_ADD, pktinfo->ip_totlen);
|
||||
}
|
||||
return APP_STATE_DROPPKT | APP_STATE_KILL_OTHER | APP_STATE_GIVEME;
|
||||
}
|
||||
|
||||
char first_data_process(struct streaminfo *stream, struct pme_info *pmeinfo, struct pkt_info *pktinfo, int thread_seq){
|
||||
@@ -1261,8 +1262,7 @@ static char data_opstate(struct streaminfo *stream, struct pme_info *pmeinfo, co
|
||||
wrapped_kni_header_parse(a_packet, pmeinfo, &pktinfo);
|
||||
//pmeinfo->action has only 2 value: KNI_ACTION_NONE, KNI_ACTION_INTERCEPT
|
||||
if(pmeinfo->action == KNI_ACTION_INTERCEPT){
|
||||
next_data_intercept(pmeinfo, a_packet, &pktinfo, thread_seq);
|
||||
return APP_STATE_DROPPKT | APP_STATE_KILL_OTHER | APP_STATE_GIVEME;
|
||||
return next_data_intercept(pmeinfo, a_packet, &pktinfo, thread_seq);
|
||||
}
|
||||
//first data
|
||||
if(stream->ptcpdetail->datalen > 0){
|
||||
|
||||
Reference in New Issue
Block a user