[{"id":3667919,"web_url":"http://patchwork.ozlabs.org/comment/3667919/","msgid":"<acF-pua5PjDy_UhO@chamomile>","list_archive_url":null,"date":"2026-03-23T17:55:50","subject":"Re: [PATCH nf-next,v2] netfilter: nft_meta: add double-tagged vlan\n and pppoe support","submitter":{"id":1315,"url":"http://patchwork.ozlabs.org/api/people/1315/","name":"Pablo Neira Ayuso","email":"pablo@netfilter.org"},"content":"On Sun, Mar 22, 2026 at 11:51:47PM +0100, Pablo Neira Ayuso wrote:\n> Currently:\n> \n>   add rule netdev x y ip saddr 1.1.1.1\n> \n> does not work with neither double-tagged vlan nor pppoe packets. This is\n> because the network and transport header offset are not pointing to the\n> IP and transport protocol headers in the stack.\n> \n> This patch expands NFT_META_PROTOCOL and NFT_META_L4PROTO to parse\n> double-tagged vlan and pppoe packets so matching network and transport\n> header fields becomes possible with the existing userspace generated\n> bytecode. Note that this parser only supports double-tagged vlan which\n> is composed of vlan offload + vlan header in the skb payload area for\n> simplicity.\n> \n> NFT_META_PROTOCOL is used by bridge and netdev family as an implicit\n> dependency in the bytecode to match on network header fields.\n> Similarly, there is also NFT_META_L4PROTO, which is also used as an\n> implicit dependency when matching on the transport protocol header\n> fields.\n> \n> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>\n> ---\n> v2: - Fix typo comment \"packer\" -> \"packet\".\n>     - Add comment to clarify this support double-tagged vlan with\n>       vlan offload + vlan header in skb data area.\n>     - remove nft_meta_protocol_store() helper function.\n>     Note: IPv6 still untested here.\n\nPPPoE with IPv4 and IPv6 is working, but there is an issue with VLAN.\n\nI will post a v3, apologies.","headers":{"Return-Path":"\n <netfilter-devel+bounces-11377-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","netfilter-devel@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=netfilter.org header.i=@netfilter.org\n header.a=rsa-sha256 header.s=2025 header.b=rB0DL6Wy;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-11377-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org\n header.b=\"rB0DL6Wy\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=217.70.190.124","smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=netfilter.org","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=netfilter.org"],"Received":["from sto.lore.kernel.org (sto.lore.kernel.org\n [IPv6:2600:3c09:e001:a7::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4ffh5V5gG8z1y1G\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 24 Mar 2026 05:09:34 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 8CCD430A3814\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 23 Mar 2026 17:56:28 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id BF3A33CB2F4;\n\tMon, 23 Mar 2026 17:55:57 +0000 (UTC)","from mail.netfilter.org (mail.netfilter.org [217.70.190.124])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id DA4FE3CAE69\n\tfor <netfilter-devel@vger.kernel.org>; Mon, 23 Mar 2026 17:55:54 +0000 (UTC)","from netfilter.org (mail-agni [217.70.190.124])\n\tby mail.netfilter.org (Postfix) with UTF8SMTPSA id 4141F60178;\n\tMon, 23 Mar 2026 18:55:52 +0100 (CET)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774288557; cv=none;\n b=pSuo8xgkPyC2PPGeCyIoqDc8l6mEhRMRjCWmfn7pq4d7Mwl6707I2RN37aKWXkwAYAlQuuLvXnXrk1bJzr4CYv5IOptnX60yoAJEvM03AC1ppPu8xtV3svNlW7llo6Z7XN0NMWo8oglp+nAIDpnG+FqIS022oRyUSVW7zt9Xl1U=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774288557; c=relaxed/simple;\n\tbh=3oKnXU3W8vxgSYikM4dK+uqplrJ3VQ405WHpNUzZklo=;\n\th=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:\n\t Content-Type:Content-Disposition:In-Reply-To;\n b=i+KnL5Phwl0I17HUrrq2ahy5h/4iCvVhttrWAaBOdwmPBff9hfaAS553u7coouTE4Onn/y0yTjraRA3CZUWnIa9tW+MVy7DJzZvmB5AnHBUTSHZr1QdxkoIXKf/wMFq6JoqpLKNp8F6hjp9cIfytWYVW1aAdRrdMreliwDI3E0Q=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=netfilter.org;\n spf=pass smtp.mailfrom=netfilter.org;\n dkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org\n header.b=rB0DL6Wy; arc=none smtp.client-ip=217.70.190.124","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=netfilter.org;\n\ts=2025; t=1774288552;\n\tbh=qFeLTMkhUSgtf3rxNbf/eR1kSfwi2aWB2JmBP8SNsU8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=rB0DL6Wy+u4ApNV38q/Bmh8ZvagFtGk1WuUNQvkyz9oS439OqsYL1X3+ZYWytdg/B\n\t 5opI/KO7L1ofURrgh0Lh4qhbAqZpYlFas6+VWkc+hASOzGKG+W7SxgaLuC6Ecf8P+o\n\t SQkDcipFzvXNm6v9Yt9ORPbfIK08N91xKhhJDlH8Hwp1ermuG2HOP/sI1D6tZHABjy\n\t M1jS1A79vUn2t5iphmnhH8oYEEdMRa+JDaDC1GkpskPApOUjxNUnFHLEqbWlVYzBTk\n\t Y0EN02jcJBrGd86SB/kGLt7QTOINcek/s6GyvfsNBOLCjQoF8xi2dOWpHP5qe88M88\n\t 0ErcSPyxt94Gw==","Date":"Mon, 23 Mar 2026 18:55:50 +0100","From":"Pablo Neira Ayuso <pablo@netfilter.org>","To":"netfilter-devel@vger.kernel.org","Cc":"fw@strlen.de","Subject":"Re: [PATCH nf-next,v2] netfilter: nft_meta: add double-tagged vlan\n and pppoe support","Message-ID":"<acF-pua5PjDy_UhO@chamomile>","References":"<20260322225147.469027-1-pablo@netfilter.org>","Precedence":"bulk","X-Mailing-List":"netfilter-devel@vger.kernel.org","List-Id":"<netfilter-devel.vger.kernel.org>","List-Subscribe":"<mailto:netfilter-devel+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:netfilter-devel+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20260322225147.469027-1-pablo@netfilter.org>"}},{"id":3667993,"web_url":"http://patchwork.ozlabs.org/comment/3667993/","msgid":"<acGmMZJSUFcT_6au@chamomile>","list_archive_url":null,"date":"2026-03-23T20:44:33","subject":"Re: [PATCH nf-next,v2] netfilter: nft_meta: add double-tagged vlan\n and pppoe support","submitter":{"id":1315,"url":"http://patchwork.ozlabs.org/api/people/1315/","name":"Pablo Neira Ayuso","email":"pablo@netfilter.org"},"content":"On Mon, Mar 23, 2026 at 06:55:50PM +0100, Pablo Neira Ayuso wrote:\n> On Sun, Mar 22, 2026 at 11:51:47PM +0100, Pablo Neira Ayuso wrote:\n> > Currently:\n> > \n> >   add rule netdev x y ip saddr 1.1.1.1\n> > \n> > does not work with neither double-tagged vlan nor pppoe packets. This is\n> > because the network and transport header offset are not pointing to the\n> > IP and transport protocol headers in the stack.\n> > \n> > This patch expands NFT_META_PROTOCOL and NFT_META_L4PROTO to parse\n> > double-tagged vlan and pppoe packets so matching network and transport\n> > header fields becomes possible with the existing userspace generated\n> > bytecode. Note that this parser only supports double-tagged vlan which\n> > is composed of vlan offload + vlan header in the skb payload area for\n> > simplicity.\n> > \n> > NFT_META_PROTOCOL is used by bridge and netdev family as an implicit\n> > dependency in the bytecode to match on network header fields.\n> > Similarly, there is also NFT_META_L4PROTO, which is also used as an\n> > implicit dependency when matching on the transport protocol header\n> > fields.\n> > \n> > Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>\n> > ---\n> > v2: - Fix typo comment \"packer\" -> \"packet\".\n> >     - Add comment to clarify this support double-tagged vlan with\n> >       vlan offload + vlan header in skb data area.\n> >     - remove nft_meta_protocol_store() helper function.\n> >     Note: IPv6 still untested here.\n> \n> PPPoE with IPv4 and IPv6 is working, but there is an issue with VLAN.\n> \n> I will post a v3, apologies.\n\nNo need for v3, actually this works fine/tested with:\n\n- vlan\n- pppoe\n- vlan/pppoe\n- vlan/vlan\n\ntesting with a simple ruleset that matches on layer 3 and 4:\n\ntable netdev x {\n        chain y {\n                type filter hook ingress device eth0 priority 0;\n                ip daddr 1.1.1.1 udp sport 12345 counter\n        }\n}\n\nso let's just reinstantiate this patch in patchwork as under review.","headers":{"Return-Path":"\n <netfilter-devel+bounces-11380-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","netfilter-devel@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=netfilter.org header.i=@netfilter.org\n header.a=rsa-sha256 header.s=2025 header.b=CkH6845A;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-11380-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org\n header.b=\"CkH6845A\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=217.70.190.124","smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=netfilter.org","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=netfilter.org"],"Received":["from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fflYR2tmgz1xy3\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 24 Mar 2026 07:45:31 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 855C13019822\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 23 Mar 2026 20:44:45 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 706D73DCD81;\n\tMon, 23 Mar 2026 20:44:42 +0000 (UTC)","from mail.netfilter.org (mail.netfilter.org [217.70.190.124])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 0AF7E3DF014\n\tfor <netfilter-devel@vger.kernel.org>; Mon, 23 Mar 2026 20:44:38 +0000 (UTC)","from netfilter.org (mail-agni [217.70.190.124])\n\tby mail.netfilter.org (Postfix) with UTF8SMTPSA id 8772260177;\n\tMon, 23 Mar 2026 21:44:36 +0100 (CET)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774298682; cv=none;\n b=O16v+1LzptyOaytakAt461Ke5/NRIBZnQPOnp4r+kXp7bcF83ZumYWLFtf7ysRrRNx+LNtU5KQrsD5RYoPY3IQBVxYaW/DWL/FPduYTWC9rM45PGl7WD/LzSNeUS/31mpnUTc1M7KqZY9t6d69AEAmiHaf+L9I43UiSgolN6X5I=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774298682; c=relaxed/simple;\n\tbh=hMEiijTr+QrN/3sITfuv7cI4A3qIFAMwNzPLdm0negY=;\n\th=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:\n\t Content-Type:Content-Disposition:In-Reply-To;\n b=sOq0FDehfPxjlUt35md2607Tzef2W4QQtUIiz0WLUA4lbl+m1EYIXxR9rRbOVjxNdRZeSkL2WRK3wMJOZgN5ZqIwM0QtprWvlCgBSXwd6D3eUpQVtYwWC42TK3niQSWSAMEf3FniDETYUfy/PuhLzB4TiLPPGHsN/vFmduISNJo=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=netfilter.org;\n spf=pass smtp.mailfrom=netfilter.org;\n dkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org\n header.b=CkH6845A; arc=none smtp.client-ip=217.70.190.124","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=netfilter.org;\n\ts=2025; t=1774298676;\n\tbh=ODqWlZMtNg9EOfxXl3ejcpoRZqxm5XmgPdXu9YeYiBo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=CkH6845AL3GM2bLOevdaYn917XAgoUT4OgvYKRVWZUp0Z5WYkR3V7NfMfCaqAC5bV\n\t n8t11B65Lgu8qoPvSLxhaU/KJUJ76Y7C3cnqAeniC41Ya4CgnR49geKOnlVDMXWPqm\n\t JbsyhajSbn5RZVLqLZnE/SxLnmrHkFhSB2Fjp/+SD52PJFHO9A4WYioatNItp2ETkx\n\t ONgqHU9PJIRW8qczn/Bd4/z1ShnPWUHYKFOwmCESED7CnSXo4EkmRAIroB6o7JXWBQ\n\t MjI39zAFWxpEmWANk9Qt+wQGgRvuDmxcvzdcAKAEbFNAT490g5uzJYTIEeaK7um5B+\n\t L4DYq/hfJ9VWQ==","Date":"Mon, 23 Mar 2026 21:44:33 +0100","From":"Pablo Neira Ayuso <pablo@netfilter.org>","To":"netfilter-devel@vger.kernel.org","Cc":"fw@strlen.de","Subject":"Re: [PATCH nf-next,v2] netfilter: nft_meta: add double-tagged vlan\n and pppoe support","Message-ID":"<acGmMZJSUFcT_6au@chamomile>","References":"<20260322225147.469027-1-pablo@netfilter.org>\n <acF-pua5PjDy_UhO@chamomile>","Precedence":"bulk","X-Mailing-List":"netfilter-devel@vger.kernel.org","List-Id":"<netfilter-devel.vger.kernel.org>","List-Subscribe":"<mailto:netfilter-devel+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:netfilter-devel+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<acF-pua5PjDy_UhO@chamomile>"}}]