Skip to contentSkip to conversation

net: update dev_fill_forward_path() to handle mac80211 special case

PATCH Superseded Pablo Neira Ayuso 1 participant 1 message Sep 14

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 net: update dev_fill_forward_path() to handle mac80211 special case

Before commit b5964aac51e0 ("netfilter: flowtable: consolidate xmit path"), there was a fallback to create a bypass in case .ndo_fill_forward_path fails.

Commit d787a3e38f01 ("mac80211: add support for .ndo_fill_forward_path") relies on such fallback, so most mac80211 drivers used to work since they do not provide a net_fill_forward_path interface.

Add a special case to dev_fill_forward_path() by returning 1 in case .ndo_fill_forward_path is implemented but this is expected to be the last device in the forward path stack.

Fixes b5964aac51e0 ("netfilter: flowtable: consolidate xmit path")
---
 net/core/dev.c       | 5 ++++-
 net/mac80211/iface.c | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)
net/core/dev.c +4 -1
index ecfbd72d5d1a..0f80cce3f02d 100644
@@ -789,13 +789,16 @@ int dev_fill_forward_path(struct net_device_path_ctx *ctx,
 			goto err_out;
 
 		stack->num_paths++;
+		if (ret > 0)
+			goto out;
+
 		if (WARN_ON_ONCE(last_dev == ctx->dev))
 			goto err_out;
 	}
 
 	if (!ctx->dev)
 		return ret;
-
+out:
 	path = dev_fwd_path(stack);
 	if (!path)
 		goto err_out;
net/mac80211/iface.c +1 -1
index 43460a705a6b..8c0cc2b4c6ed 100644
@@ -998,7 +998,7 @@ static int ieee80211_netdev_fill_forward_path(struct net_device_path_ctx *ctx,
 	local = sdata->local;
 
 	if (!local->ops->net_fill_forward_path)
-		return -EOPNOTSUPP;
+		return 1;
 
 	rcu_read_lock();
 	switch (sdata->vif.type) {
Signature · 1 line
2.47.3