qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V12 07/10] colo-compare: add TCP, UDP, ICMP pack


From: Jason Wang
Subject: Re: [Qemu-devel] [PATCH V12 07/10] colo-compare: add TCP, UDP, ICMP packet comparison
Date: Thu, 1 Sep 2016 15:40:21 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0



On 2016年09月01日 13:00, Zhang Chen wrote:
+    /*
+     * The 'identification' field in the IP header is *very* random
+     * it almost never matches.  Fudge this by ignoring differences in
+ * unfragmented packets; they'll normally sort themselves out if different
+     * anyway, and it should recover at the TCP level.
+ * An alternative would be to get both the primary and secondary to rewrite + * somehow; but that would need some sync traffic to sync the state
+     */
+    if (ntohs(ppkt->ip->ip_off) & IP_DF) {
+        spkt->ip->ip_id = ppkt->ip->ip_id;
+        /* and the sum will be different if the IDs were different */
+        spkt->ip->ip_sum = ppkt->ip->ip_sum;
+    }
+
+    res = memcmp(ppkt->data + ETH_HLEN, spkt->data + ETH_HLEN,
+                (spkt->size - ETH_HLEN));

This may work but I worry about whether or not tagged packet can work here. Looks like parse_packet_early() can recognize vlan tag, but fill_connection_key() can not. This looks can result queuing wrong packets into wrong connection.

Currently COLO proxy can't support vlan, we will add this feature in the future.

Looks like current code can still queue vlan packets, please make sure it can't.

Thanks



reply via email to

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