From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 123DE15AE7 for ; Wed, 20 Sep 2023 12:16:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D491C43395; Wed, 20 Sep 2023 12:16:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1695212209; bh=sYD+MIIC8a95yi4keKMGGcEnT2y34N0zp6igkPKJuNc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dyK4FPj6x7LwwRqrEURDLKw1AyFDq9UEQ670iUlCcN/70iJxu7iILYclJVyvyDC6S eVIbk1nqn67M+zC4XUfhistYc/r2vgEq8RmV6g9Ft+F6QF+cgZDXA3ZOJXUnLHCNoY IRMQBoVTs9xi4kWte0JYhiW/6f4jQwupeYPWj9yI= 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.19 190/273] net: handle ARPHRD_PPP in dev_is_mac_header_xmit() Date: Wed, 20 Sep 2023 13:30:30 +0200 Message-ID: <20230920112852.381646658@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230920112846.440597133@linuxfoundation.org> References: <20230920112846.440597133@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 4.19-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;