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

Reply via email to