[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V2 2/4] net/colo-compare.c: Compare the tcp pack
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-devel] [PATCH V2 2/4] net/colo-compare.c: Compare the tcp packets that has the same sequence number |
Date: |
Fri, 14 Jul 2017 13:24:21 +0100 |
User-agent: |
Mutt/1.8.3 (2017-05-23) |
* Zhang Chen (address@hidden) wrote:
> If primary packet's sequence number not same with secondary packet's
> sequence number, no need to compare the packet other field.
>
> Signed-off-by: Zhang Chen <address@hidden>
> ---
> net/colo-compare.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/net/colo-compare.c b/net/colo-compare.c
> index 0f8e198..2caeb80 100644
> --- a/net/colo-compare.c
> +++ b/net/colo-compare.c
> @@ -222,6 +222,12 @@ static int colo_packet_compare_tcp(Packet *spkt, Packet
> *ppkt)
> ptcp = (struct tcphdr *)ppkt->transport_header;
> stcp = (struct tcphdr *)spkt->transport_header;
>
> + if ((ptcp->th_flags & TH_SYN) != TH_SYN &&
> + ptcp->th_seq != stcp->th_seq) {
> + trace_colo_compare_main("colo_packet_compare_tcp seq not same");
> + return -1;
> + }
Do you need to check that the stcp->th_flags is the same ?
Looking back at patches I had in this area; I was doing
if (ptcp->th_flags == stcp->th_flags &&
see:
https://github.com/orbitfp7/qemu/commit/848ca1113aec802dd032fd5b6d6b301931b3e1e0
Dave
> /*
> * The 'identification' field in the IP header is *very* random
> * it almost never matches. Fudge this by ignoring differences in
> --
> 2.7.4
>
>
>
>
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK
- [Qemu-devel] [PATCH V2 3/4] net/colo-compare.c: Optimize unpredictable tcp options comparison, (continued)
Re: [Qemu-devel] [PATCH V2 2/4] net/colo-compare.c: Compare the tcp packets that has the same sequence number,
Dr. David Alan Gilbert <=