Discussion:
[PATCH] mac80211: pass hostapd control socket to mesh-mode supplicant
(too old to reply)
Daniel Golle
2018-04-12 23:41:31 UTC
Permalink
Unlike when operating in Ad-Hoc mode, we apparently need to pass the
hostapd control socket interface to wpa_supplicant when using 802.11s
mesh mode.

There also seems to still be something wrong with the logic setting
channel and (v)htmode parameters when using AP + mesh...

Signed-off-by: Daniel Golle <***@makrotopia.org>
---
package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index bf9d52ae42..3a1d475a5c 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -633,7 +633,7 @@ mac80211_setup_vif() {
if [ -n "$key" ]; then
wireless_vif_parse_encryption
freq="$(get_freq "$phy" "$channel")"
- mac80211_setup_supplicant_noctl || failed=1
+ mac80211_setup_supplicant || failed=1
else
json_get_vars mesh_id mcast_rate
--
2.17.0
Sven Eckelmann
2018-04-13 09:34:28 UTC
Permalink
Post by Daniel Golle
Unlike when operating in Ad-Hoc mode, we apparently need to pass the
hostapd control socket interface to wpa_supplicant when using 802.11s
mesh mode.
There also seems to still be something wrong with the logic setting
channel and (v)htmode parameters when using AP + mesh...
I haven't tested the current state but this was basically breaking encrypted
mesh + AP (AP never came up). Problem was the code (OpenWrt specific) in
wpa_supplicant which called STOP_AP via this socket.

Kind regards,
Sven
Felix Fietkau
2018-04-13 09:37:22 UTC
Permalink
Post by Sven Eckelmann
Post by Daniel Golle
Unlike when operating in Ad-Hoc mode, we apparently need to pass the
hostapd control socket interface to wpa_supplicant when using 802.11s
mesh mode.
There also seems to still be something wrong with the logic setting
channel and (v)htmode parameters when using AP + mesh...
I haven't tested the current state but this was basically breaking encrypted
mesh + AP (AP never came up). Problem was the code (OpenWrt specific) in
wpa_supplicant which called STOP_AP via this socket.
The control socket code was written for AP+Client. It usually calls
STOP_AP before it attempts a new scan + assoc. When the interface is
connected again, it starts the AP again on the new operating frequency.
I don't think the problem is STOP_AP itself, I think the problem is the
lack of a start call when the mesh interface is set up properly.

- Felix
daniel
2018-04-19 10:52:56 UTC
Permalink
This patch breaks encrypted mesh mode.

I agree, there is still something wrong with the logic when using encrypted mesh.
Also the setting of the mesh parameters fails, because nl80211_mesh_join must
happen before nl80211_update_mesh_config. This results in these errors:
---
netifd: radio1 (6314): command failed: Link has been severed (-67)
---
Originating from net/wireless/nl80211.c:nl80211_update_mesh_config():6133
through calling in 'iw set mesh_params' at /lib/netifd/wireless/mac80211.sh:678

When using mesh without encryption this is not an issue, because
'iw mesh_join' is called before 'iw set mesh_params'
in '/lib/netifd/wireless/mac80211.sh:678

With encryption the setting of the parameters need to happen after
wpa_supplicant triggered nl80211_mesh_join.

But I don't know how to solve this properly yet either...
Post by Daniel Golle
Unlike when operating in Ad-Hoc mode, we apparently need to pass the
hostapd control socket interface to wpa_supplicant when using 802.11s
mesh mode.
There also seems to still be something wrong with the logic setting
channel and (v)htmode parameters when using AP + mesh...
---
package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index bf9d52ae42..3a1d475a5c 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -633,7 +633,7 @@ mac80211_setup_vif() {
if [ -n "$key" ]; then
wireless_vif_parse_encryption
freq="$(get_freq "$phy" "$channel")"
- mac80211_setup_supplicant_noctl || failed=1
+ mac80211_setup_supplicant || failed=1
else
json_get_vars mesh_id mcast_rate
--
Regards

Daniel Danzberger
embeDD GmbH, Alter Postplatz 2, CH-6370 Stans
Daniel Golle
2018-04-19 11:04:45 UTC
Permalink
Hi Daniel
Post by daniel
This patch breaks encrypted mesh mode.
Yes, I reverted it yesterday afternoon...
Post by daniel
I agree, there is still something wrong with the logic when using encrypted mesh.
Yes, and that's on my agenda for tonight (fixing /lib/netifd/wireless/mac80211.sh)
Post by daniel
Also the setting of the mesh parameters fails, because nl80211_mesh_join must
---
netifd: radio1 (6314): command failed: Link has been severed (-67)
---
Originating from net/wireless/nl80211.c:nl80211_update_mesh_config():6133
through calling in 'iw set mesh_params' at /lib/netifd/wireless/mac80211.sh:678
When using mesh without encryption this is not an issue, because
'iw mesh_join' is called before 'iw set mesh_params'
in '/lib/netifd/wireless/mac80211.sh:678
With encryption the setting of the parameters need to happen after
wpa_supplicant triggered nl80211_mesh_join.
But I don't know how to solve this properly yet either...
Making wpa_supplicant set the mesh parameters (it already does that,
but uses non-configurable default values). I added support to at least
handle mesh_fwding, because it was what I needed for my use-case, see

https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=ff8df2b3f9c161edc3ab543bdbeb04a9fb45c959


Cheers


Daniel
Post by daniel
Post by Daniel Golle
Unlike when operating in Ad-Hoc mode, we apparently need to pass the
hostapd control socket interface to wpa_supplicant when using 802.11s
mesh mode.
There also seems to still be something wrong with the logic setting
channel and (v)htmode parameters when using AP + mesh...
---
package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index bf9d52ae42..3a1d475a5c 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -633,7 +633,7 @@ mac80211_setup_vif() {
if [ -n "$key" ]; then
wireless_vif_parse_encryption
freq="$(get_freq "$phy" "$channel")"
- mac80211_setup_supplicant_noctl || failed=1
+ mac80211_setup_supplicant || failed=1
else
json_get_vars mesh_id mcast_rate
--
Regards
Daniel Danzberger
embeDD GmbH, Alter Postplatz 2, CH-6370 Stans
_______________________________________________
Lede-dev mailing list
http://lists.infradead.org/mailman/listinfo/lede-dev
Loading...