[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCHv7 4/9] slirp: Factorizing tcpiphdr structure wit
From: |
Samuel Thibault |
Subject: |
Re: [Qemu-devel] [PATCHv7 4/9] slirp: Factorizing tcpiphdr structure with an union |
Date: |
Mon, 22 Feb 2016 02:48:48 +0100 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Hello,
Thomas Huth, on Fri 19 Feb 2016 14:44:59 +0100, wrote:
> > + m->m_data -= sizeof(struct tcpiphdr) - (sizeof(struct ip)
> > + + sizeof(struct tcphdr));
> > + m->m_len += 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 += 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 -= sizeof(struct tcpiphdr) - (sizeof(struct ip)
> - sizeof(struct tcphdr));
> i.e. "-" instead of "+" here ----------------^
The parentheses and indentation were misleading actually, here is how it
should actually looks like:
> > + m->m_data -= sizeof(struct tcpiphdr) - ( sizeof(struct ip)
> > + + sizeof(struct tcphdr));
I've now dropped the parentheses, so it looks like the tcp_output.c code:
m->m_data -= sizeof(struct tcpiphdr) - sizeof(struct ip)
- sizeof(struct tcphdr);
Samuel
- [Qemu-devel] [PATCHv7 2/9] slirp: Adding ICMPv6 error sending, (continued)
[Qemu-devel] [PATCHv7 7/9] slirp: Handle IPv6 in TCP functions, Samuel Thibault, 2016/02/14
[Qemu-devel] [PATCHv7 9/9] qapi-schema, qemu-options & slirp: Adding Qemu options for IPv6 addresses, Samuel Thibault, 2016/02/14
[Qemu-devel] [PATCHv7 8/9] slirp: Adding IPv6 address for DNS relay, Samuel Thibault, 2016/02/14