Le 14/01/2019 à 16:38, Willem de Bruijn a écrit :
> On Mon, Jan 14, 2019 at 10:15 AM Willem de Bruijn
> <willemdebruijn.ker...@gmail.com> wrote:
[snip]
>> It is wrong because for other devices l2 header length is not zero, so
>> this incorrectly sets skb->network_header to the start of the link
>> layer header on all those devices.
Ok, thank you for the details.

>>
>> A one line variant of the above would be
>>
>> -               if (len < reserve)
>> +               if (len < reserve + sizeof(struct ipv6hdr))
> 
> and exclude the majority of devices with fixed hard header len. Those
> require len to be >= reserve, so this workaround does not apply to
> them:
> 
> if (len < reserve + sizeof(struct ipv6hdr) &&
>     dev->min_header_len != dev->hard_header_len)
> 
And what about:
- if (len < reserve)
+ if (dev->min_header_len != dev->hard_header_len)
        skb_reset_network_header(skb);
?

Reply via email to