* [Qemu-devel] [PATCH V2] net/filter-rewriter.c: Fix coverity static analysis issue
@ 2018-10-31 0:50 Zhang Chen
2018-11-02 2:21 ` Jason Wang
0 siblings, 1 reply; 4+ messages in thread
From: Zhang Chen @ 2018-10-31 0:50 UTC (permalink / raw)
To: qemu-devel, Peter Maydell, Jason Wang; +Cc: Zhang Chen, Zhang Chen
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>
---
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);
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH V2] net/filter-rewriter.c: Fix coverity static analysis issue
2018-10-31 0:50 [Qemu-devel] [PATCH V2] net/filter-rewriter.c: Fix coverity static analysis issue Zhang Chen
@ 2018-11-02 2:21 ` Jason Wang
2018-11-15 10:32 ` Peter Maydell
0 siblings, 1 reply; 4+ messages in thread
From: Jason Wang @ 2018-11-02 2:21 UTC (permalink / raw)
To: Zhang Chen, qemu-devel, Peter Maydell; +Cc: Zhang Chen
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 <zhangckid@gmail.com>
> ---
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH V2] net/filter-rewriter.c: Fix coverity static analysis issue
2018-11-02 2:21 ` Jason Wang
@ 2018-11-15 10:32 ` Peter Maydell
2018-11-16 2:21 ` Jason Wang
0 siblings, 1 reply; 4+ messages in thread
From: Peter Maydell @ 2018-11-15 10:32 UTC (permalink / raw)
To: Jason Wang; +Cc: Zhang Chen, QEMU Developers, Zhang Chen
On 2 November 2018 at 02:21, Jason Wang <jasowang@redhat.com> wrote:
>
> 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 <zhangckid@gmail.com>
>> ---
>> 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.
Ping -- this doesn't seem to have made it into master?
thanks
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH V2] net/filter-rewriter.c: Fix coverity static analysis issue
2018-11-15 10:32 ` Peter Maydell
@ 2018-11-16 2:21 ` Jason Wang
0 siblings, 0 replies; 4+ messages in thread
From: Jason Wang @ 2018-11-16 2:21 UTC (permalink / raw)
To: Peter Maydell; +Cc: Zhang Chen, QEMU Developers, Zhang Chen
On 2018/11/15 下午6:32, Peter Maydell wrote:
> On 2 November 2018 at 02:21, Jason Wang <jasowang@redhat.com> wrote:
>> 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 <zhangckid@gmail.com>
>>> ---
>>> 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.
> Ping -- this doesn't seem to have made it into master?
>
> thanks
> -- PMM
>
Will send a pull request soon.
Thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-11-16 2:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-31 0:50 [Qemu-devel] [PATCH V2] net/filter-rewriter.c: Fix coverity static analysis issue Zhang Chen
2018-11-02 2:21 ` Jason Wang
2018-11-15 10:32 ` Peter Maydell
2018-11-16 2:21 ` Jason Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).