提交 013a6202 编写于 作者: Z Zhang Chen 提交者: Jason Wang

net/filter-rewriter.c: Fix coverity static analysis issue

The original code just follow the TCP state diagram,
but in this case, we can skip the TCPS_TIME_WAIT state to simplify
the implementation.
Signed-off-by: NZhang Chen <zhangckid@gmail.com>
Signed-off-by: NJason Wang <jasowang@redhat.com>
上级 d835c619
......@@ -155,12 +155,13 @@ static int handle_primary_tcp_pkt(RewriterState *rf,
* Active close step 2.
*/
if (conn->tcp_state == TCPS_FIN_WAIT_1) {
conn->tcp_state = TCPS_TIME_WAIT;
/*
* For simplify implementation, we needn't wait 2MSL time
* in filter rewriter. Because guest kernel will track the
* TCP status and wait 2MSL time, if client resend the FIN
* packet, guest will apply the last ACK too.
* So, we skip the TCPS_TIME_WAIT state here and go straight
* to TCPS_CLOSED state.
*/
conn->tcp_state = TCPS_CLOSED;
g_hash_table_remove(rf->connection_track_table, key);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册