解决IPv6下转发部分数据包失败问题
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
|
||||
|
||||
|
||||
const char *g_kni_fs2_name[FS2_COLUMN_NUM] ={"RECV_PKTS","WRITE_PKTS","READ_PKTS","SEND_PKTS","BMD_IP","BMD_DOMAIN","HTTP_PKTS","SSL_PKTS","DROP_PKTS","CLIENT_HELLO","SSL_SNI"};
|
||||
const char *g_kni_fs2_name[FS2_COLUMN_NUM] ={"recv_from_sapp","send_to_tun","read_from_tun","send_to_sapp","white_ip","white_domain","http","ssl","drop_other","client_hello","ssl_sni","drop_sapp_ipv6","drop_tun_htable"};
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
#define FS2_COLUMN_NUM 11
|
||||
#define FS2_COLUMN_NUM 13
|
||||
#define FS2_APPNAME "KNI"
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ enum kni_FS_COLUME
|
||||
FS2_COLUME_DROPPKT,
|
||||
FS2_COLUME_CLIENTHELLO,
|
||||
FS2_COLUME_SNI,
|
||||
FS2_COLUME_DROP_SAPP,
|
||||
FS2_COLUME_DROP_TUN,
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -616,8 +616,8 @@ int kni_keepalive_replay_v6(struct stream_tuple4_v6* ipv6_addr,int iprever_flag,
|
||||
{
|
||||
snd_tcphdr->th_seq=htonl(ntohl(snd_tcphdr->th_seq)+1);
|
||||
}
|
||||
sendpacket_do_checksum((unsigned char*)sendbuf,IPPROTO_TCP,htonl(ipv6_hdr->ip6_payload_len));
|
||||
sendpacket_do_checksum((unsigned char*)sendbuf,IPPROTO_IP,sizeof(struct kni_ipv6_hdr));
|
||||
sendpacket_do_checksum((unsigned char*)sendbuf,IPPROTO_TCP,htons(ipv6_hdr->ip6_payload_len));
|
||||
// sendpacket_do_checksum((unsigned char*)sendbuf,IPPROTO_IP,sizeof(struct kni_ipv6_hdr));
|
||||
|
||||
tun_write_data(g_kni_comminfo.fd_tun[thread_seq],sendbuf,iplen,NULL,thread_seq);
|
||||
|
||||
@@ -853,6 +853,10 @@ int kni_process_readdata(int thread_seq,int sendpkt_threadid,int buflen,char* bu
|
||||
MESA_sendpacket_iplayer_options(thread_seq,buf,buflen,args.routdir,NULL,0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
kni_filestate2_set(thread_seq,FS2_COLUME_DROP_TUN,0,1);
|
||||
}
|
||||
|
||||
}
|
||||
else if((ipv6_hdr->ip6_flags[0] & 0xF0) == 0x60)
|
||||
@@ -877,6 +881,10 @@ int kni_process_readdata(int thread_seq,int sendpkt_threadid,int buflen,char* bu
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
kni_filestate2_set(thread_seq,FS2_COLUME_DROP_TUN,0,1);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
@@ -727,6 +727,8 @@ extern "C" char kni_tcpall_entry(const struct streaminfo* pstream,void** pme,int
|
||||
|
||||
if((a_packet != NULL) && (ipv6_hdr->ip6_nex_hdr != NEXTHDR_TCP))
|
||||
{
|
||||
|
||||
kni_filestate2_set(thread_seq,FS2_COLUME_DROP_SAPP,0,1);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user