Hello again,

In addition, it should be better to set the default key management type for
WPAS_MODE_MESH.

----
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index 6f8edc4..0a1c0f2 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -143,6 +143,16 @@ static int wpa_config_validate_network(struct wpa_ssid
*ssid, int line)
                ssid->group_cipher &= ~WPA_CIPHER_CCMP;
        }

+#ifdef CONFIG_MESH
+       /*
+        * set default key_mgmt for mesh mode.
+        * currently set no encryption.
+        */
+       if (ssid->mode == WPAS_MODE_MESH && ssid->key_mgmt ==
DEFAULT_KEY_MGMT) {
+           ssid->key_mgmt = WPA_KEY_MGMT_NONE;
+       }
+#endif /* CONFIG_MESH */
+
        return errors;
 }

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 1a8b6b7..670f586 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -2654,6 +2654,18 @@ static int wpa_supplicant_ctrl_iface_set_network(
        else if (os_strcmp(name, "no_auto_peer") == 0)
                ssid->no_auto_peer = atoi(value);

+#ifdef CONFIG_MESH
+       /*
+        *  set default key_mgmt for mesh.
+        *  currently no encryption is default.
+        */
+       if (os_strcmp(name, "mode") == 0 &&
+        atoi(value) == WPAS_MODE_MESH &&
+        ssid->key_mgmt == DEFAULT_KEY_MGMT) {
+           ssid->key_mgmt = WPA_KEY_MGMT_NONE;
+       }
+#endif /* CONFIG_MESH */
+
        return 0;
 }



---------------------------------------------------

Also, related to the key management, STATUS command should be improved.
Although there are more rooms for improvement, the following changes should
be helpful.

----
diff --git a/src/common/wpa_common.c b/src/common/wpa_common.c
index 37b265d..6524e99 100644
--- a/src/common/wpa_common.c
+++ b/src/common/wpa_common.c
@@ -969,6 +969,10 @@ const char * wpa_key_mgmt_txt(int key_mgmt, int proto)
        case WPA_KEY_MGMT_PSK_SHA256:
                return "WPA2-PSK-SHA256";
 #endif /* CONFIG_IEEE80211W */
+#ifdef CONFIG_SAE
+       case WPA_KEY_MGMT_SAE:
+           return "SAE";
+#endif /* CONFIG_SAE */
        default:
                return "UNKNOWN";
        }
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 670f586..c45c2a8 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -1643,6 +1643,10 @@ static int wpa_supplicant_ctrl_iface_status(struct
wpa_supplicant *wpa_s,
                                                  "mode=P2P GO - group "
                                                  "formation\n");
                                break;
+                       case WPAS_MODE_MESH:
+                           ret = os_snprintf(pos, end - pos,
+                                   "mode=MESH\n");
+                           break;
                        default:
                                ret = 0;
                                break;
diff --git a/wpa_supplicant/mesh_rsn.c b/wpa_supplicant/mesh_rsn.c
index 423e784..4eb72b7 100644
--- a/wpa_supplicant/mesh_rsn.c
+++ b/wpa_supplicant/mesh_rsn.c
@@ -67,6 +67,7 @@ static int auth_start_ampe(void *ctx, const u8 *addr)

        if (mesh_rsn->wpa_s->current_ssid->mode != WPAS_MODE_MESH)
                return -1;
+       wpa_supplicant_set_state(mesh_rsn->wpa_s, WPA_COMPLETED);

        mesh_mpm_auth_peer(mesh_rsn->wpa_s, addr);
        return 0;



--Yu
_______________________________________________
Devel mailing list
Devel@lists.open80211s.org
http://lists.open80211s.org/cgi-bin/mailman/listinfo/devel

Reply via email to