aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorZhang Chen <zhangckid@gmail.com>2018-10-31 08:50:15 +0800
committerJason Wang <jasowang@redhat.com>2018-11-16 11:08:26 +0800
commit013a62020a92f371555c67342424f2f944b62be4 (patch)
tree04465bb84b3c08ac15ecccdbdd3d94655613fe43 /net
parentd835c6192495dc5b2c3a15a0761eb57d8d310828 (diff)
downloadqemu-013a62020a92f371555c67342424f2f944b62be4.zip
qemu-013a62020a92f371555c67342424f2f944b62be4.tar.gz
qemu-013a62020a92f371555c67342424f2f944b62be4.tar.bz2
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: Zhang Chen <zhangckid@gmail.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'net')
-rw-r--r--net/filter-rewriter.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/filter-rewriter.c b/net/filter-rewriter.c
index bb8f4d9..2e26839 100644
--- a/net/filter-rewriter.c
+++ b/net/filter-rewriter.c
@@ -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);