On 22.02.2016 02:48, Samuel Thibault wrote:
> 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);

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


Reply via email to