[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241018131754.ikrrnsspjsu5ppfz@skbuf>
Date: Fri, 18 Oct 2024 16:17:54 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: Eric Woudstra <ericwouds@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Pablo Neira Ayuso <pablo@...filter.org>,
Jozsef Kadlecsik <kadlec@...filter.org>,
Roopa Prabhu <roopa@...dia.com>,
Nikolay Aleksandrov <razor@...ckwall.org>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Jiri Pirko <jiri@...nulli.us>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Lorenzo Bianconi <lorenzo@...nel.org>,
Frank Wunderlich <frank-w@...lic-files.de>,
Daniel Golle <daniel@...rotopia.org>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, netfilter-devel@...r.kernel.org,
coreteam@...filter.org, bridge@...ts.linux.dev,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH RFC v1 net-next 02/12] netfilter: bridge: Add conntrack
double vlan and pppoe
On Sun, Oct 13, 2024 at 08:54:58PM +0200, Eric Woudstra wrote:
> This adds the capability to conntrack 802.1ad, QinQ, PPPoE and PPPoE-in-Q
> packets that are passing a bridge.
>
> Signed-off-by: Eric Woudstra <ericwouds@...il.com>
> ---
Whatever you choose to do forward with these patches, please squash this
build fix here (you can drop my authorship info and commit message):
>From e73315196c3143de2af2fe39e3b0e95391849d6c Mon Sep 17 00:00:00 2001
From: Vladimir Oltean <vladimir.oltean@....com>
Date: Fri, 18 Oct 2024 13:59:27 +0300
Subject: [PATCH] netfilter: bridge: fix build failures in nf_ct_bridge_pre()
clang-16 fails to build, stating:
net/bridge/netfilter/nf_conntrack_bridge.c:257:3: error: expected expression
struct ppp_hdr {
^
net/bridge/netfilter/nf_conntrack_bridge.c:262:20: error: use of undeclared identifier 'ph'
data_len = ntohs(ph->hdr.length) - 2;
^
net/bridge/netfilter/nf_conntrack_bridge.c:262:20: error: use of undeclared identifier 'ph'
net/bridge/netfilter/nf_conntrack_bridge.c:262:20: error: use of undeclared identifier 'ph'
net/bridge/netfilter/nf_conntrack_bridge.c:262:20: error: use of undeclared identifier 'ph'
net/bridge/netfilter/nf_conntrack_bridge.c:265:11: error: use of undeclared identifier 'ph'
switch (ph->proto) {
^
net/bridge/netfilter/nf_conntrack_bridge.c:278:3: error: expected expression
struct vlan_hdr *vhdr = (struct vlan_hdr *)(skb->data);
^
net/bridge/netfilter/nf_conntrack_bridge.c:283:17: error: use of undeclared identifier 'vhdr'
inner_proto = vhdr->h_vlan_encapsulated_proto;
^
One cannot have variable declarations placed this way in a switch/case
statement, a new scope must be opened.
Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
---
net/bridge/netfilter/nf_conntrack_bridge.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/bridge/netfilter/nf_conntrack_bridge.c b/net/bridge/netfilter/nf_conntrack_bridge.c
index fb2f79396aa0..31e2bcd71735 100644
--- a/net/bridge/netfilter/nf_conntrack_bridge.c
+++ b/net/bridge/netfilter/nf_conntrack_bridge.c
@@ -253,7 +253,7 @@ static unsigned int nf_ct_bridge_pre(void *priv, struct sk_buff *skb,
return NF_ACCEPT;
switch (skb->protocol) {
- case htons(ETH_P_PPP_SES):
+ case htons(ETH_P_PPP_SES): {
struct ppp_hdr {
struct pppoe_hdr hdr;
__be16 proto;
@@ -273,7 +273,8 @@ static unsigned int nf_ct_bridge_pre(void *priv, struct sk_buff *skb,
return NF_ACCEPT;
}
break;
- case htons(ETH_P_8021Q):
+ }
+ case htons(ETH_P_8021Q): {
struct vlan_hdr *vhdr = (struct vlan_hdr *)(skb->data);
data_len = 0xffffffff;
@@ -281,6 +282,7 @@ static unsigned int nf_ct_bridge_pre(void *priv, struct sk_buff *skb,
outer_proto = skb->protocol;
inner_proto = vhdr->h_vlan_encapsulated_proto;
break;
+ }
default:
data_len = 0xffffffff;
break;
--
2.43.0
Powered by blists - more mailing lists