blob: bd1d4d7565a9645784b65e372505fdc10ffe5309 [file] [log] [blame]
developer7b43f2d2022-04-29 17:53:25 +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
22@@ -1624,6 +1624,7 @@ struct wpa_driver_mesh_join_params {
23 #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
32@@ -10496,6 +10496,18 @@ static int nl80211_put_mesh_id(struct nl
33 }
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 {
51@@ -10557,6 +10569,7 @@ static int nl80211_join_mesh(struct i802
52 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
61@@ -631,6 +631,7 @@ int wpa_supplicant_join_mesh(struct wpa_
62
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;