summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2026-07-28 18:30:43 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2026-07-31 14:47:03 +0200
commit5be6e044bea648cc0cc083899c72252f7f2227fd (patch)
treef858235365b6ea7bb6a38afce4e0fa4c8d4d2ee3
parentdf1705f289ba27ef951a87f20d41a109e7d3f40c (diff)
downloadlinux-next-5be6e044bea648cc0cc083899c72252f7f2227fd.tar.gz
linux-next-5be6e044bea648cc0cc083899c72252f7f2227fd.zip
net: dsa: stop at the user device in .fill_forward_path
The flowtable path discovery stops at the DSA user device when setting up the forward path. Let's just report there is no more devices after the DSA user port through the .fill_forward_path interface. No functional changes are intended. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--net/dsa/user.c3
-rw-r--r--net/netfilter/nf_flow_table_path.c7
2 files changed, 3 insertions, 7 deletions
diff --git a/net/dsa/user.c b/net/dsa/user.c
index 03c7af6abe18..4065c6ee6fc6 100644
--- a/net/dsa/user.c
+++ b/net/dsa/user.c
@@ -2547,14 +2547,13 @@ static int dsa_user_fill_forward_path(struct net_device_path_ctx *ctx,
struct net_device_path *path)
{
struct dsa_port *dp = dsa_user_to_port(ctx->dev);
- struct net_device *conduit = dsa_port_to_conduit(dp);
struct dsa_port *cpu_dp = dp->cpu_dp;
path->dev = ctx->dev;
path->type = DEV_PATH_DSA;
path->dsa.proto = cpu_dp->tag_ops->proto;
path->dsa.port = dp->index;
- ctx->dev = conduit;
+ ctx->dev = NULL;
return 0;
}
diff --git a/net/netfilter/nf_flow_table_path.c b/net/netfilter/nf_flow_table_path.c
index 8f04a4487897..004dc75ac357 100644
--- a/net/netfilter/nf_flow_table_path.c
+++ b/net/netfilter/nf_flow_table_path.c
@@ -114,12 +114,9 @@ static int nft_dev_path_info(const struct net_device_path_stack *stack,
if (is_zero_ether_addr(info->h_source))
memcpy(info->h_source, path->dev->dev_addr, ETH_ALEN);
- if (path->type == DEV_PATH_ETHERNET)
+ if (path->type == DEV_PATH_ETHERNET ||
+ path->type == DEV_PATH_DSA)
break;
- if (path->type == DEV_PATH_DSA) {
- i = stack->num_paths;
- break;
- }
/* DEV_PATH_VLAN, DEV_PATH_PPPOE and DEV_PATH_TUN */
if (path->type == DEV_PATH_TUN) {