summaryrefslogtreecommitdiff
path: root/net/colo.c
diff options
context:
space:
mode:
authorZhang Chen <zhangckid@gmail.com>2018-09-14 01:47:53 +0000
committerJason Wang <jasowang@redhat.com>2018-10-19 11:15:03 +0800
commit6214231abde01119d3084a67262d35e909bd9414 (patch)
tree2669fc7a3a5d9d71667a56d5905648caf3218693 /net/colo.c
parent77f7c747193662edfadeeb3118d63eed0eac51a6 (diff)
downloadqemu-6214231abde01119d3084a67262d35e909bd9414.zip
filter-rewriter: Add TCP state machine and fix memory leak in connection_track_table
We add almost full TCP state machine in filter-rewriter, except TCPS_LISTEN and some simplify in VM active close FIN states. The reason for this simplify job is because guest kernel will track the TCP status and wait 2MSL time too, if client resend the FIN packet, guest will resend the last ACK, so we needn't wait 2MSL time in filter-rewriter. After a net connection is closed, we didn't clear its related resources in connection_track_table, which will lead to memory leak. Let's track the state of net connection, if it is closed, its related resources will be cleared up. Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Signed-off-by: Zhang Chen <zhangckid@gmail.com> Signed-off-by: Zhang Chen <chen.zhang@intel.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'net/colo.c')
-rw-r--r--net/colo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/colo.c b/net/colo.c
index 6dda4ed66e..97c8fc928f 100644
--- a/net/colo.c
+++ b/net/colo.c
@@ -137,7 +137,7 @@ Connection *connection_new(ConnectionKey *key)
conn->ip_proto = key->ip_proto;
conn->processing = false;
conn->offset = 0;
- conn->syn_flag = 0;
+ conn->tcp_state = TCPS_CLOSED;
conn->pack = 0;
conn->sack = 0;
g_queue_init(&conn->primary_list);