aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMasashi Honma <masashi.honma@gmail.com>2016-08-05 08:35:30 (GMT)
committerJouni Malinen <j@w1.fi>2016-08-18 17:40:13 (GMT)
commit2bd62171737b45a094027378a6ad70f567cb68ff (patch)
tree7805ba5f273fc606cac70f38118e6393ac9ecfc3 /src
parent4ffb3f870d912d1ac625e5ab2f61b07728ecd19d (diff)
downloadhostap-2bd62171737b45a094027378a6ad70f567cb68ff.zip
hostap-2bd62171737b45a094027378a6ad70f567cb68ff.tar.gz
hostap-2bd62171737b45a094027378a6ad70f567cb68ff.tar.bz2
mesh: Use WPA_DRIVER_MESH_CONF_FLAG_* as modification flag
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/driver.h5
-rw-r--r--src/drivers/driver_nl80211.c17
2 files changed, 15 insertions, 7 deletions
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 4dd731f..ffe6f75 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -1118,12 +1118,15 @@ struct wpa_driver_ap_params {
};
struct wpa_driver_mesh_bss_params {
-#define WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS 0x00000001
+#define WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS 0x00000001
+#define WPA_DRIVER_MESH_CONF_FLAG_PEER_LINK_TIMEOUT 0x00000002
+#define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS 0x00000004
/*
* TODO: Other mesh configuration parameters would go here.
* See NL80211_MESHCONF_* for all the mesh config parameters.
*/
unsigned int flags;
+ int auto_plinks;
int peer_link_timeout;
int max_peer_links;
};
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index cbbcf66..b801c9c 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -8422,18 +8422,20 @@ static int nl80211_put_mesh_config(struct nl_msg *msg,
if (!container)
return -1;
- if (nla_put_u32(msg, NL80211_MESHCONF_AUTO_OPEN_PLINKS,
- !!(params->flags &
- WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS)) ||
- nla_put_u16(msg, NL80211_MESHCONF_MAX_PEER_LINKS,
- params->max_peer_links))
+ if (((params->flags & WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS) &&
+ nla_put_u32(msg, NL80211_MESHCONF_AUTO_OPEN_PLINKS,
+ params->auto_plinks)) ||
+ ((params->flags & WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS) &&
+ nla_put_u16(msg, NL80211_MESHCONF_MAX_PEER_LINKS,
+ params->max_peer_links)))
return -1;
/*
* Set NL80211_MESHCONF_PLINK_TIMEOUT even if user mpm is used because
* the timer could disconnect stations even in that case.
*/
- if (nla_put_u32(msg, NL80211_MESHCONF_PLINK_TIMEOUT,
+ if ((params->flags & WPA_DRIVER_MESH_CONF_FLAG_PEER_LINK_TIMEOUT) &&
+ nla_put_u32(msg, NL80211_MESHCONF_PLINK_TIMEOUT,
params->peer_link_timeout)) {
wpa_printf(MSG_ERROR, "nl80211: Failed to set PLINK_TIMEOUT");
return -1;
@@ -8489,6 +8491,9 @@ static int nl80211_join_mesh(struct i802_bss *bss,
goto fail;
nla_nest_end(msg, container);
+ params->conf.flags |= WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS;
+ params->conf.flags |= WPA_DRIVER_MESH_CONF_FLAG_PEER_LINK_TIMEOUT;
+ params->conf.flags |= WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS;
if (nl80211_put_mesh_config(msg, &params->conf) < 0)
goto fail;