aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/mesh.c
diff options
context:
space:
mode:
authorBob Copeland <me@bobcopeland.com>2014-03-11 04:07:01 (GMT)
committerJouni Malinen <j@w1.fi>2014-10-25 14:45:31 (GMT)
commit5f92659d88f17ba8cd11210a70e17ba664a62d53 (patch)
treec591ea2b1b609fec3702f9f758fd142d167af4fe /wpa_supplicant/mesh.c
parente45e898970e29f5f21e2815a2c75714129d7ae20 (diff)
downloadhostap-5f92659d88f17ba8cd11210a70e17ba664a62d53.zip
hostap-5f92659d88f17ba8cd11210a70e17ba664a62d53.tar.gz
hostap-5f92659d88f17ba8cd11210a70e17ba664a62d53.tar.bz2
mesh: Add mesh peering manager
The mesh peering manager establishes and maintains links among mesh peers, tracking each peer link via a finite state machine. This implementation supports open mesh peerings. [assorted fixes from Yu Niiro <yu.niiro@gmail.com>] [more fixes from Masashi Honma <masashi.honma@gmail.com>] Signed-off-by: Javier Lopez <jlopex@gmail.com> Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: Ashok Nagarajan <ashok.dragon@gmail.com> Signed-off-by: Jason Mobarak <x@jason.mobarak.name> Signed-hostap: Bob Copeland <me@bobcopeland.com>
Diffstat (limited to 'wpa_supplicant/mesh.c')
-rw-r--r--wpa_supplicant/mesh.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
index 320440c..efacf70 100644
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -21,6 +21,7 @@
#include "wpa_supplicant_i.h"
#include "driver_i.h"
#include "notify.h"
+#include "mesh_mpm.h"
#include "mesh.h"
@@ -41,6 +42,7 @@ void wpa_supplicant_mesh_iface_deinit(struct wpa_supplicant *wpa_s,
return;
if (ifmsh->mconf) {
+ mesh_mpm_deinit(wpa_s, ifmsh);
if (ifmsh->mconf->ies) {
ifmsh->mconf->ies = NULL;
/* We cannot free this struct
@@ -117,6 +119,13 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
static int default_groups[] = { 19, 20, 21, 25, 26, -1 };
size_t len;
+ if (!wpa_s->conf->user_mpm) {
+ /* not much for us to do here */
+ wpa_msg(wpa_s, MSG_WARNING,
+ "user_mpm is not enabled in configuration");
+ return 0;
+ }
+
wpa_s->ifmsh = ifmsh = os_zalloc(sizeof(*wpa_s->ifmsh));
if (!ifmsh)
return -ENOMEM;
@@ -149,6 +158,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
bss->iconf = conf;
ifmsh->conf = conf;
+ ifmsh->bss[0]->max_plinks = 99;
os_strlcpy(bss->conf->iface, wpa_s->ifname, sizeof(bss->conf->iface));
mconf = mesh_config_create(ssid);
@@ -241,7 +251,9 @@ void wpa_mesh_notify_peer(struct wpa_supplicant *wpa_s, const u8 *addr,
if (ieee802_11_parse_elems(ies, ie_len, &elems, 0) == ParseFailed) {
wpa_msg(wpa_s, MSG_INFO, "Could not parse beacon from " MACSTR,
MAC2STR(addr));
+ return;
}
+ wpa_mesh_new_mesh_peer(wpa_s, addr, &elems);
}
@@ -266,10 +278,16 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s,
if (ssid->key_mgmt & WPA_KEY_MGMT_SAE) {
params.flags |= WPA_DRIVER_MESH_FLAG_SAE_AUTH;
params.flags |= WPA_DRIVER_MESH_FLAG_AMPE;
+ wpa_s->conf->user_mpm = 1;
}
- params.flags |= WPA_DRIVER_MESH_FLAG_DRIVER_MPM;
- params.conf.flags |= WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS;
+ if (wpa_s->conf->user_mpm) {
+ params.flags |= WPA_DRIVER_MESH_FLAG_USER_MPM;
+ params.conf.flags &= ~WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS;
+ } else {
+ params.flags |= WPA_DRIVER_MESH_FLAG_DRIVER_MPM;
+ params.conf.flags |= WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS;
+ }
if (wpa_supplicant_mesh_init(wpa_s, ssid)) {
wpa_msg(wpa_s, MSG_ERROR, "Failed to init mesh");