Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5590066pxj; Wed, 23 Jun 2021 04:53:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4f3qRkEQf0WoW/qzYq2cGil28gemDXMCp9M3Az5uPN4lYkYbqvWx5pReOiSsZzl0kENRS X-Received: by 2002:aa7:d801:: with SMTP id v1mr11854240edq.349.1624449221101; Wed, 23 Jun 2021 04:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624449221; cv=none; d=google.com; s=arc-20160816; b=TihzIqrU6aouQmaRJfTAfGQ5A+JCWa8Y6txVEru0ESbu0EBnuQH2Lxb0fpaA1939hi Z5kRJMPUy1kU6MgfnqAy4i8vC3mPMdZA4USMb+ssRosydyGrXt7ESu6V02EaN0wwp5fu Vai9w7trGRC/w9wIaxQAHPYpt1e2eOTRz0h3ln0cE71EhYUrOAFy/CfwI/L9Bav4cau2 CsemWVi5nUae0SfxP1XpV2FnSntch6UoNKHvmqcfsfE1xkgpmxyVcARnVBWPb2690Dh3 PQzlolsDorS00ccC1216n2EwWfutWKuicciA7RNx9bxwsidbvWTPSociCI8oqBmcqcq3 q5Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=rR9T9s/UFtNh2oOuM3Ok8r7X32RYieSk7qFU5jCYw5I=; b=UTqXYccoj6G6ICJyMJ47+AfP4kreMivvppN/lqhdzPEXcV+aMWgrnQsPotScBBhDLu 3AWJJ0qWEvAtGa9LvE0/I3oibeh1x0uZOigyi/9aJ0ErTT5/cHKtp8PjnuYrMnIbmJi+ xLjlj+aJwuwEUuPmAhJKG3AqmIPEZKuCDADOPQf/7i4LUJ6eQvkI0hQCTpty8kmhIJ8w O5QIjYYlKqK7swRU7/YL3O6eydQ0nrAbw2D7MBj4/L+kB7q3L97PiaRrR6TGkgEp2H/q GA8GtQlo57wsqXBpsX6zlb7SdcepgcEEo6pMRvgaWgPeXe+Cmj9maWA7kVYq9MFlNo7Y PppQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dq22si1415137ejc.661.2021.06.23.04.53.17; Wed, 23 Jun 2021 04:53:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230449AbhFWLwU (ORCPT + 99 others); Wed, 23 Jun 2021 07:52:20 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:56529 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S230019AbhFWLwS (ORCPT ); Wed, 23 Jun 2021 07:52:18 -0400 X-UUID: e5c50f87811e4ff8902f0e9b34026b36-20210623 X-UUID: e5c50f87811e4ff8902f0e9b34026b36-20210623 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1980747268; Wed, 23 Jun 2021 19:49:55 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 23 Jun 2021 19:49:54 +0800 Received: from localhost.localdomain (10.15.20.246) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 23 Jun 2021 19:49:53 +0800 From: Rocco Yue To: "David S . Miller" , Jakub Kicinski , Jonathan Corbet , Hideaki YOSHIFUJI , David Ahern , Matthias Brugger , Felix Fietkau , John Crispin , Sean Wang , Mark Lee CC: , , , , , , , , , , Rocco Yue Subject: [PATCH 3/4] net: dev_is_mac_header_xmit() return false for ARPHRD_PUREIP Date: Wed, 23 Jun 2021 19:34:51 +0800 Message-ID: <20210623113452.5671-3-rocco.yue@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210623113452.5671-1-rocco.yue@mediatek.com> References: <20210623113452.5671-1-rocco.yue@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org the incoming/outgoing packets on that pure ip interface do not have an ethernet header. So adding ARPHRD_PUREIP to the dev_is_mac_header_xmit() make the function return false, and __bpf_redirect() checks this boolean to determine whether to prefix an ethernet header. Signed-off-by: Rocco Yue --- include/linux/if_arp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index bf5c5f32c65e..0dc7af11c463 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h @@ -51,6 +51,7 @@ static inline bool dev_is_mac_header_xmit(const struct net_device *dev) case ARPHRD_VOID: case ARPHRD_NONE: case ARPHRD_RAWIP: + case ARPHRD_PUREIP: return false; default: return true; -- 2.18.0