qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH V3 3/3] filter-rewriter: rewrite tcp packet


From: Jason Wang
Subject: Re: [Qemu-devel] [RFC PATCH V3 3/3] filter-rewriter: rewrite tcp packet to keep secondary connection
Date: Thu, 28 Jul 2016 10:04:57 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0



On 2016年07月27日 17:05, Zhang Chen wrote:
+    if (((tcp_pkt->th_flags & (TH_ACK | TH_SYN)) == TH_ACK)) {
+        if (conn->syn_flag) {
+            /* offset = secondary_seq - primary seq */
+            conn->offset -= (ntohl(tcp_pkt->th_ack) - 1);

The code here is conflict with your comment above. Why need - 1 here?

(ntohl(tcp_pkt->th_ack) - 1) is the primary seq
So, we need -1 here.

Thanks
Zhang Chen

Aha, right. Since we can't get the syn,ack packet sent by guest from primary node.

Better add a comment to explain this.

Thanks



reply via email to

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