qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] COLO-compare: Fix incorrect `if` logic


From: Jason Wang
Subject: Re: [PATCH] COLO-compare: Fix incorrect `if` logic
Date: Wed, 25 Sep 2019 12:20:33 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 2019/9/24 下午11:35, Philippe Mathieu-Daudé wrote:
> Hi Fan,
>
> you forgot to Cc the maintainers (doing that for you):
>
> ./scripts/get_maintainer.pl -f net/colo-compare.c
> Zhang Chen <address@hidden> (supporter:COLO Proxy)
> Li Zhijian <address@hidden> (supporter:COLO Proxy)
> Jason Wang <address@hidden> (maintainer:Network device ba...)
> address@hidden (open list:All patches CC here)
>
> On 9/24/19 4:08 PM, Fan Yang wrote:
>> 'colo_mark_tcp_pkt' should return 'true' when packets are the same, and
>> 'false' otherwise.  However, it returns 'true' when
>> 'colo_compare_packet_payload' returns non-zero while
>> 'colo_compare_packet_payload' is just a 'memcmp'.  The result is that
>> COLO-compare reports inconsistent TCP packets when they are actually
>> the same.
>>
> Fixes: f449c9e549c
> Reviewed-by: Philippe Mathieu-Daudé <address@hidden>


Applied.

Thanks


>
>> Signed-off-by: Fan Yang <address@hidden>
>> ---
>>  net/colo-compare.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/net/colo-compare.c b/net/colo-compare.c
>> index 7489840bde..7ee17f2cf8 100644
>> --- a/net/colo-compare.c
>> +++ b/net/colo-compare.c
>> @@ -319,7 +319,7 @@ static bool colo_mark_tcp_pkt(Packet *ppkt, Packet *spkt,
>>      *mark = 0;
>>  
>>      if (ppkt->tcp_seq == spkt->tcp_seq && ppkt->seq_end == spkt->seq_end) {
>> -        if (colo_compare_packet_payload(ppkt, spkt,
>> +        if (!colo_compare_packet_payload(ppkt, spkt,
>>                                          ppkt->header_size, 
>> spkt->header_size,
>>                                          ppkt->payload_size)) {
>>              *mark = COLO_COMPARE_FREE_SECONDARY | COLO_COMPARE_FREE_PRIMARY;
>> @@ -329,7 +329,7 @@ static bool colo_mark_tcp_pkt(Packet *ppkt, Packet *spkt,
>>  
>>      /* one part of secondary packet payload still need to be compared */
>>      if (!after(ppkt->seq_end, spkt->seq_end)) {
>> -        if (colo_compare_packet_payload(ppkt, spkt,
>> +        if (!colo_compare_packet_payload(ppkt, spkt,
>>                                          ppkt->header_size + ppkt->offset,
>>                                          spkt->header_size + spkt->offset,
>>                                          ppkt->payload_size - ppkt->offset)) 
>> {
>> @@ -348,7 +348,7 @@ static bool colo_mark_tcp_pkt(Packet *ppkt, Packet *spkt,
>>          /* primary packet is longer than secondary packet, compare
>>           * the same part and mark the primary packet offset
>>           */
>> -        if (colo_compare_packet_payload(ppkt, spkt,
>> +        if (!colo_compare_packet_payload(ppkt, spkt,
>>                                          ppkt->header_size + ppkt->offset,
>>                                          spkt->header_size + spkt->offset,
>>                                          spkt->payload_size - spkt->offset)) 
>> {
>>



reply via email to

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