From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXlMw-0002rf-QH for qemu-devel@nongnu.org; Mon, 22 Feb 2016 02:57:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXlMt-0006Z5-JQ for qemu-devel@nongnu.org; Mon, 22 Feb 2016 02:57:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35756) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXlMt-0006Yn-EP for qemu-devel@nongnu.org; Mon, 22 Feb 2016 02:57:19 -0500 References: <56C71C5B.1040805@redhat.com> <20160222014848.GQ1957@var.home> From: Thomas Huth Message-ID: <56CABF4B.5030002@redhat.com> Date: Mon, 22 Feb 2016 08:56:59 +0100 MIME-Version: 1.0 In-Reply-To: <20160222014848.GQ1957@var.home> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCHv7 4/9] slirp: Factorizing tcpiphdr structure with an union List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Samuel Thibault Cc: zhanghailiang , Li Zhijian , Stefan Hajnoczi , Jason Wang , Dave Gilbert , Vasiliy Tolstov , qemu-devel@nongnu.org, Gonglei , Jan Kiszka , Huangpeng , Guillaume Subiron On 22.02.2016 02:48, Samuel Thibault wrote: > Hello, >=20 > Thomas Huth, on Fri 19 Feb 2016 14:44:59 +0100, wrote: >>> + m->m_data -=3D sizeof(struct tcpiphdr) - (sizeof(struct ip) >>> + + sizeof(struct tcphdr)); >>> + m->m_len +=3D sizeof(struct tcpiphdr) - (sizeof(struct ip) >>> + + sizeof(struct tcphdr)); >> >> I'm somewhat having a hard time to understand the "+ sizeof(struct >> tcphdr))" here. >> >> In the tcp_output.c code, there is this: >> >> m->m_data +=3D sizeof(struct tcpiphdr) - sizeof(struct tcphdr) >> - sizeof(struct ip); >> >> So with my limited point of view, I'd rather expect this here in >> tcp_input.c: >> >> m->m_data -=3D sizeof(struct tcpiphdr) - (sizeof(struct ip) >> - sizeof(struct tcphdr)); >> i.e. "-" instead of "+" here ----------------^ >=20 > The parentheses and indentation were misleading actually, here is how i= t > should actually looks like: >=20 >>> + m->m_data -=3D sizeof(struct tcpiphdr) - ( sizeof(struct ip) >>> + + sizeof(struct tcphdr)); >=20 > I've now dropped the parentheses, so it looks like the tcp_output.c cod= e: >=20 > m->m_data -=3D sizeof(struct tcpiphdr) - sizeof(struct ip) > - sizeof(struct tcphdr); Ah, sorry, I indeed simply got confused because it was written in two different ways :-/ ... would it maybe be applicable to use the TCPIPHDR_DELTA macro here instead? Apart from that, the patch looks ok to me. Thomas