alibaba / LVS

A distribution of Linux Virtual Server with some advanced features. It introduces a new packet forwarding method - FULLNAT other than NAT/Tunneling/DirectRouting, and defense mechanism against synflooding attack - SYNPROXY.
2k stars 682 forks source link

fullnat模式,client发起访问,链接莫名被LVS 双向RESET掉 #23

Open justcurry opened 7 years ago

justcurry commented 7 years ago

client ip: 3.3.3.12 VIP : 3.3.3.9 laddr: 3.3.3.10 rs: 3.3.3.13 在客户端上抓包和后端RS同时抓包发现,当三次握手建立之后,客户端过来一个数据请求包,LVS就把这个链接RESET掉了,后端RS稍微有点不一样,LVS把客户端的数据请求包转发给了RS,RS也回了一个ACK给LVS,但是LVS在收到这个ACK之后就回了一个RESET给RS,请教一下这个大概会是什么导致的,另外,源代码中的哪个文件是处理这种异常链接的,我想想看看源码,LVS在什么时候会发这种RESET包,谢谢了

mlsm commented 7 years ago

master版本,在set_tcp_state()函数中,有如下代码: cp->timeout = ((cp->state = new_state) == IP_VS_TCP_S_ESTABLISHED) ? cp->est_timeout : sysctl_ip_vs_tcp_timeouts[new_state]; ,但是代码中没有对cp->est_timeout赋值,此值为0,从而导致会话超时想两端发送rst。可以在创建会话是设置下cp->est_timeout,即可。