* 修复收到重复syn/ack时,kni_get_tcpopt的内存泄漏

* uuid需要加锁,修改traceid的生成方式为pid+clocktime
   * 重新整理fs2的各项统计
   * 修改stream_error发通联日志的信息
This commit is contained in:
崔一鸣
2019-09-20 19:15:32 +08:00
parent f8b1d371e3
commit f54dfbf86f
3 changed files with 280 additions and 218 deletions

View File

@@ -144,9 +144,7 @@ uint16_t kni_udp_checksum(const void *_buf, size_t len, in_addr_t src_addr, in_a
return ( (uint16_t)(~sum) );
}
struct kni_tcpopt_info* kni_get_tcpopt(struct tcphdr* tcphdr,int tcphdr_len){
struct kni_tcpopt_info* tcpopt = (struct kni_tcpopt_info*)ALLOC(struct kni_tcpopt_info, 1);
void kni_get_tcpopt(struct kni_tcpopt_info *tcpopt, struct tcphdr* tcphdr,int tcphdr_len){
tcpopt->mss = KNI_DEFAULT_MSS;
tcpopt->wscale = KNI_DEFAULT_WINSCLE;
@@ -158,16 +156,16 @@ struct kni_tcpopt_info* kni_get_tcpopt(struct tcphdr* tcphdr,int tcphdr_len){
int opsize;
switch (opcode){
case TCPOPT_EOL:
return tcpopt;
return;
case TCPOPT_NOP: /* Ref: RFC 793 section 3.1 */
length--;
continue;
default:
opsize = *ptr++;
if (opsize < 2) /* "silly options" */
return tcpopt;
return;
if (opsize > length)
return tcpopt; /* don't parse partial options */
return; /* don't parse partial options */
switch (opcode){
case TCPOPT_MAXSEG:
if (opsize == TCPOLEN_MAXSEG){
@@ -208,7 +206,7 @@ struct kni_tcpopt_info* kni_get_tcpopt(struct tcphdr* tcphdr,int tcphdr_len){
length -= opsize;
}
}
return tcpopt;
return;
}