Received: from eggs.gnu.org ([2001:4830:134:3::10]:37126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSahA-0000ZI-5A for qemu-devel@nongnu.org; Wed, 27 Jul 2016 22:05:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSah5-0000dM-VC for qemu-devel@nongnu.org; Wed, 27 Jul 2016 22:05:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSah5-0000dH-PE for qemu-devel@nongnu.org; Wed, 27 Jul 2016 22:05:03 -0400 References: <1467714580-17581-1-git-send-email-zhangchen.fnst@cn.fujitsu.com> <1467714580-17581-4-git-send-email-zhangchen.fnst@cn.fujitsu.com> <3fe7364f-4835-ec6c-2077-7d38901c874a@cn.fujitsu.com> From: Jason Wang Message-ID: <7f5188b9-01e3-1d33-110b-89fa94042352@redhat.com> Date: Thu, 28 Jul 2016 10:04:57 +0800 MIME-Version: 1.0 In-Reply-To: <3fe7364f-4835-ec6c-2077-7d38901c874a@cn.fujitsu.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH V3 3/3] filter-rewriter: rewrite tcp packet to keep secondary connection List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Zhang Chen , qemu devel Cc: "eddie . dong" , Li Zhijian On 2016=E5=B9=B407=E6=9C=8827=E6=97=A5 17:05, Zhang Chen wrote: >>> + if (((tcp_pkt->th_flags & (TH_ACK | TH_SYN)) =3D=3D TH_ACK)) { >>> + if (conn->syn_flag) { >>> + /* offset =3D secondary_seq - primary seq */ >>> + conn->offset -=3D (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=20 primary node. Better add a comment to explain this. Thanks