blob: 5dc19fedee1f69940623647972aef098bc7cde30 [file] [log] [blame]
developer4e0da232022-05-09 13:05:53 +08001From: Sven Eckelmann <sven.eckelmann@openmesh.com>
2Date: Thu, 11 May 2017 08:21:45 +0200
3Subject: [PATCH] set mcast_rate in mesh mode
4
5The wpa_supplicant code for IBSS allows to set the mcast rate. It is
6recommended to increase this value from 1 or 6 Mbit/s to something higher
7when using a mesh protocol on top which uses the multicast packet loss as
8indicator for the link quality.
9
10This setting was unfortunately not applied for mesh mode. But it would be
11beneficial when wpa_supplicant would behave similar to IBSS mode and set
12this argument during mesh join like authsae already does. At least it is
13helpful for companies/projects which are currently switching to 802.11s
14(without mesh_fwding and with mesh_ttl set to 1) as replacement for IBSS
15because newer drivers seem to support 802.11s but not IBSS anymore.
16
17Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
18Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
19
20--- a/src/drivers/driver.h
21+++ b/src/drivers/driver.h
developer198585d2022-09-22 17:12:54 +080022@@ -1661,6 +1661,7 @@ struct wpa_driver_mesh_join_params {
developer4e0da232022-05-09 13:05:53 +080023 #define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
24 unsigned int flags;
25 bool handle_dfs;
26+ int mcast_rate;
27 };
28
29 struct wpa_driver_set_key_params {
30--- a/src/drivers/driver_nl80211.c
31+++ b/src/drivers/driver_nl80211.c
developer198585d2022-09-22 17:12:54 +080032@@ -10627,6 +10627,18 @@ static int nl80211_put_mesh_id(struct nl
developer4e0da232022-05-09 13:05:53 +080033 }
34
35
36+static int nl80211_put_mcast_rate(struct nl_msg *msg, int mcast_rate)
37+{
38+ if (mcast_rate > 0) {
39+ wpa_printf(MSG_DEBUG, " * mcast_rate=%.1f",
40+ (double)mcast_rate / 10);
41+ return nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, mcast_rate);
42+ }
43+
44+ return 0;
45+}
46+
47+
48 static int nl80211_put_mesh_config(struct nl_msg *msg,
49 struct wpa_driver_mesh_bss_params *params)
50 {
developer198585d2022-09-22 17:12:54 +080051@@ -10688,6 +10700,7 @@ static int nl80211_join_mesh(struct i802
developer4e0da232022-05-09 13:05:53 +080052 nl80211_put_basic_rates(msg, params->basic_rates) ||
53 nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) ||
54 nl80211_put_beacon_int(msg, params->beacon_int) ||
55+ nl80211_put_mcast_rate(msg, params->mcast_rate) ||
56 nl80211_put_dtim_period(msg, params->dtim_period))
57 goto fail;
58
59--- a/wpa_supplicant/mesh.c
60+++ b/wpa_supplicant/mesh.c
developer198585d2022-09-22 17:12:54 +080061@@ -632,6 +632,7 @@ int wpa_supplicant_join_mesh(struct wpa_
developer4e0da232022-05-09 13:05:53 +080062
63 params->meshid = ssid->ssid;
64 params->meshid_len = ssid->ssid_len;
65+ params->mcast_rate = ssid->mcast_rate;
66 ibss_mesh_setup_freq(wpa_s, ssid, &params->freq);
67 wpa_s->mesh_ht_enabled = !!params->freq.ht_enabled;
68 wpa_s->mesh_vht_enabled = !!params->freq.vht_enabled;