From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D361CE79D1 for ; Wed, 20 Sep 2023 12:05:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235215AbjITMF2 (ORCPT ); Wed, 20 Sep 2023 08:05:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235341AbjITMFI (ORCPT ); Wed, 20 Sep 2023 08:05:08 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5DC6B6 for ; Wed, 20 Sep 2023 05:05:01 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05EE4C433C7; Wed, 20 Sep 2023 12:05:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1695211501; bh=NXNn9kvmb7KNZbpuQW2KFDdmhZsQGunfAWWvP2L2+I4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NAntD+NMkf7z0iCVHqOwtIkBqEvaMXtrV+YTB+BquIQtXSNtF6Lz5gsFutVZlxb7S 5SYlSoURtVoaIrw1P6kwr9n057DsvNmdUa4+Vih4WwSr7v3ENk9zwP6zAuby78b+ze B0lJSLqGnXx66/a0cPmurmN18EgMLMUJ4ts9O1PA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Nicolas Dichtel , Siwar Zitouni , Guillaume Nault , "David S. Miller" Subject: [PATCH 4.14 117/186] net: handle ARPHRD_PPP in dev_is_mac_header_xmit() Date: Wed, 20 Sep 2023 13:30:20 +0200 Message-ID: <20230920112841.263657630@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230920112836.799946261@linuxfoundation.org> References: <20230920112836.799946261@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nicolas Dichtel commit a4f39c9f14a634e4cd35fcd338c239d11fcc73fc upstream. The goal is to support a bpf_redirect() from an ethernet device (ingress) to a ppp device (egress). The l2 header is added automatically by the ppp driver, thus the ethernet header should be removed. CC: stable@vger.kernel.org Fixes: 27b29f63058d ("bpf: add bpf_redirect() helper") Signed-off-by: Nicolas Dichtel Tested-by: Siwar Zitouni Reviewed-by: Guillaume Nault Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- include/linux/if_arp.h | 4 ++++ 1 file changed, 4 insertions(+) --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h @@ -56,6 +56,10 @@ static inline bool dev_is_mac_header_xmi case ARPHRD_NONE: case ARPHRD_RAWIP: case ARPHRD_PIMREG: + /* PPP adds its l2 header automatically in ppp_start_xmit(). + * This makes it look like an l3 device to __bpf_redirect() and tcf_mirred_init(). + */ + case ARPHRD_PPP: return false; default: return true;