]> git.ipfire.org Git - thirdparty/hostap.git/blobdiff - wpa_supplicant/ctrl_iface.c
mesh: Add MESH_PEER_ADD command
[thirdparty/hostap.git] / wpa_supplicant / ctrl_iface.c
index cc75514a0f1e5f065c40999e4aca8233a3d70e8d..36fc4b44df597a4ec9b5e5382c999175512cddec 100644 (file)
@@ -2739,6 +2739,18 @@ static int wpa_supplicant_ctrl_iface_mesh_peer_remove(
        return wpas_mesh_peer_remove(wpa_s, addr);
 }
 
+
+static int wpa_supplicant_ctrl_iface_mesh_peer_add(
+       struct wpa_supplicant *wpa_s, char *cmd)
+{
+       u8 addr[ETH_ALEN];
+
+       if (hwaddr_aton(cmd, addr))
+               return -1;
+
+       return wpas_mesh_peer_add(wpa_s, addr);
+}
+
 #endif /* CONFIG_MESH */
 
 
@@ -8587,6 +8599,9 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
        } else if (os_strncmp(buf, "MESH_PEER_REMOVE ", 17) == 0) {
                if (wpa_supplicant_ctrl_iface_mesh_peer_remove(wpa_s, buf + 17))
                        reply_len = -1;
+       } else if (os_strncmp(buf, "MESH_PEER_ADD ", 14) == 0) {
+               if (wpa_supplicant_ctrl_iface_mesh_peer_add(wpa_s, buf + 14))
+                       reply_len = -1;
 #endif /* CONFIG_MESH */
 #ifdef CONFIG_P2P
        } else if (os_strncmp(buf, "P2P_FIND ", 9) == 0) {