FAILED: patch "[PATCH] cfg80211: correct bridge/4addr mode check" failed to apply to 4.9-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 689a0a9f505f7bffdefe6f17fddb41c8ab6344f6 Mon Sep 17 00:00:00 2001
From: Janusz Dziedzic <[email protected]>
Date: Sun, 24 Oct 2021 22:15:46 +0200
Subject: [PATCH] cfg80211: correct bridge/4addr mode check
Without the patch we fail:
$ sudo brctl addbr br0 $ sudo brctl addif br0 wlp1s0 $ sudo iw wlp1s0 set 4addr on command failed: Device or resource busy (-16)
Last command failed but iface was already in 4addr mode.
Fixes ad4bb6f8883a ("cfg80211: disallow bridging managed/adhoc interfaces")
Signed-off-by Janusz Dziedzic <[email protected]>
[add fixes tag, fix indentation, edit commit log]
Signed-off-by Johannes Berg <[email protected]>
net/wireless/util.c +7 -7
@@ -1028,14 +1028,14 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev, !(rdev->wiphy.interface_modes & (1 << ntype)))return -EOPNOTSUPP ; -/* if it's part of a bridge, reject changing type to station/ibss */ -if (netif_is_bridge_port (dev) && - (ntype ==NL80211_IFTYPE_ADHOC || - ntype ==NL80211_IFTYPE_STATION || - ntype ==NL80211_IFTYPE_P2P_CLIENT )) -return -EBUSY ; -if (ntype != otype) { +/* if it's part of a bridge, reject changing type to station/ibss */ +if (netif_is_bridge_port (dev) && + (ntype ==NL80211_IFTYPE_ADHOC || + ntype ==NL80211_IFTYPE_STATION || + ntype ==NL80211_IFTYPE_P2P_CLIENT )) +return -EBUSY ; + dev->ieee80211_ptr->use_4addr = false; dev->ieee80211_ptr->mesh_id_up_len =0 ;wdev_lock (dev->ieee80211_ptr);