From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Dichtel Subject: Re: [PATCH net] af_packet: fix raw sockets over 6in4 tunnel Date: Tue, 15 Jan 2019 10:49:49 +0100 Message-ID: <3ebfc32c-6c2e-626b-493f-27e326ddb5b9@6wind.com> References: <20190111144357.9700-1-nicolas.dichtel@6wind.com> <7baad0fc-6352-0350-5acd-76b9d780e89e@6wind.com> Reply-To: nicolas.dichtel@6wind.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: David Miller , Network Development To: Willem de Bruijn Return-path: Received: from mail-wm1-f67.google.com ([209.85.128.67]:38908 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727560AbfAOJty (ORCPT ); Tue, 15 Jan 2019 04:49:54 -0500 Received: by mail-wm1-f67.google.com with SMTP id m22so2483921wml.3 for ; Tue, 15 Jan 2019 01:49:53 -0800 (PST) In-Reply-To: Content-Language: fr Sender: netdev-owner@vger.kernel.org List-ID: Le 14/01/2019 à 16:38, Willem de Bruijn a écrit : > On Mon, Jan 14, 2019 at 10:15 AM Willem de Bruijn > 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); ?