qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V2] net/filter-rewriter.c: Fix coverity static a


From: Jason Wang
Subject: Re: [Qemu-devel] [PATCH V2] net/filter-rewriter.c: Fix coverity static analysis issue
Date: Fri, 2 Nov 2018 10:21:57 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1


On 2018/10/31 上午8:50, Zhang Chen wrote:
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 <address@hidden>
---
  net/filter-rewriter.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/filter-rewriter.c b/net/filter-rewriter.c
index bb8f4d93b1..2e26839bc2 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);


Applied.

Thanks




reply via email to

[Prev in Thread] Current Thread [Next in Thread]