当Sapp收到的IP包进行分片重组后,KNI发给TFE的包需重新计算IPv4的校验和
This commit is contained in:
@@ -790,12 +790,43 @@ static int send_to_tfe_tun_mode(char *raw_data, uint16_t raw_len, addr_type_t ad
|
||||
static int send_to_tfe(char *raw_data, uint16_t raw_len, int thread_seq, int tfe_id, addr_type_t addr_type){
|
||||
int mode = g_kni_handle->deploy_mode;
|
||||
int ret;
|
||||
if(mode == KNI_DEPLOY_MODE_TUN){
|
||||
ret = send_to_tfe_tun_mode(raw_data, raw_len, addr_type);
|
||||
|
||||
if (addr_type == ADDR_TYPE_IPV6)
|
||||
{
|
||||
if (mode == KNI_DEPLOY_MODE_TUN)
|
||||
{
|
||||
ret = send_to_tfe_tun_mode(raw_data, raw_len, addr_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = send_to_tfe_normal_mode(raw_data, raw_len, thread_seq, tfe_id, addr_type);
|
||||
}
|
||||
}
|
||||
else{
|
||||
ret = send_to_tfe_normal_mode(raw_data, raw_len, thread_seq, tfe_id, addr_type);
|
||||
else
|
||||
{
|
||||
struct pkt_info pktinfo;
|
||||
memset(&pktinfo, 0, sizeof(pkt_info));
|
||||
|
||||
char *ptr = (char *)malloc(raw_len);
|
||||
memcpy(ptr, raw_data, raw_len);
|
||||
kni_ipv4_header_parse((void*)ptr, &pktinfo);
|
||||
struct iphdr *iphdr = (struct iphdr*)ptr;
|
||||
iphdr->check = 0;
|
||||
iphdr->check = kni_ip_checksum((void*)iphdr, pktinfo.iphdr_len);
|
||||
|
||||
if (mode == KNI_DEPLOY_MODE_TUN)
|
||||
{
|
||||
ret = send_to_tfe_tun_mode(ptr, raw_len, addr_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = send_to_tfe_normal_mode(ptr, raw_len, thread_seq, tfe_id, addr_type);
|
||||
}
|
||||
|
||||
free(ptr);
|
||||
ptr = NULL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user