]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
mesh: Implement mesh scanning
authorJason Abele <jason.abele@gmail.com>
Mon, 1 Sep 2014 04:23:32 +0000 (00:23 -0400)
committerJouni Malinen <j@w1.fi>
Sat, 25 Oct 2014 14:45:35 +0000 (17:45 +0300)
When mesh is configured in, include the wildcard mesh id so that mesh
networks are returned.

Signed-off-by: Javier Lopez <jlopex@gmail.com>
Signed-off-by: Jason Abele <jason.abele@gmail.com>
wpa_supplicant/mesh.c
wpa_supplicant/mesh.h
wpa_supplicant/scan.c

index efacf7081383526ce0d0871668ca756d78985878..0c160d89e3622aa2f536a37a30fe34071f71607b 100644 (file)
@@ -257,6 +257,19 @@ void wpa_mesh_notify_peer(struct wpa_supplicant *wpa_s, const u8 *addr,
 }
 
 
+void wpa_supplicant_mesh_add_scan_ie(struct wpa_supplicant *wpa_s,
+                                    struct wpabuf **extra_ie)
+{
+       /* EID + 0-length (wildcard) mesh-id */
+       size_t ielen = 2;
+
+       if (wpabuf_resize(extra_ie, ielen) == 0) {
+               wpabuf_put_u8(*extra_ie, WLAN_EID_MESH_ID);
+               wpabuf_put_u8(*extra_ie, 0);
+       }
+}
+
+
 int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s,
                             struct wpa_ssid *ssid)
 {
index 34a0ea2e9a96f4a8b15a83eb48c3a3b0526ea13a..44188a917d7fa4b8596195118fe4cd920383e2db 100644 (file)
@@ -19,6 +19,8 @@ void wpa_supplicant_mesh_iface_deinit(struct wpa_supplicant *wpa_s,
 
 void wpa_mesh_notify_peer(struct wpa_supplicant *wpa_s, const u8 *addr,
                          const u8 *ies, size_t ie_len);
+void wpa_supplicant_mesh_add_scan_ie(struct wpa_supplicant *wpa_s,
+                                    struct wpabuf **extra_ie);
 
 #else /* CONFIG_MESH */
 
@@ -28,6 +30,11 @@ static inline void wpa_mesh_notify_peer(struct wpa_supplicant *wpa_s,
 {
 }
 
+static inline void wpa_supplicant_mesh_add_scan_ie(struct wpa_supplicant *wpa_s,
+                                                  struct wpabuf **extra_ie)
+{
+}
+
 #endif /* CONFIG_MESH */
 
 #endif /* MESH_H */
index debceb91361b46785519014c54dd5eb6a041e47f..b95182ec451017c78f268fd1ee76b46639e6c6ab 100644 (file)
@@ -22,6 +22,7 @@
 #include "notify.h"
 #include "bss.h"
 #include "scan.h"
+#include "mesh.h"
 
 
 static void wpa_supplicant_gen_assoc_event(struct wpa_supplicant *wpa_s)
@@ -460,6 +461,8 @@ static struct wpabuf * wpa_supplicant_extra_ies(struct wpa_supplicant *wpa_s)
        }
 #endif /* CONFIG_P2P */
 
+       wpa_supplicant_mesh_add_scan_ie(wpa_s, &extra_ie);
+
 #endif /* CONFIG_WPS */
 
 #ifdef CONFIG_HS20