wpa_supplicant doesn't start when no password is set

Guy Morand Morand
Thu Aug 18 08:18:43 PDT 2011


Hello everyone,

I'm playing with wpa_supplicant, it's working greate, thanks for the excellent job!

However, I sometime use the "save" command to save my current configuration and it writes that kind of configuration. I never edit the file myself, I only configure my network with wpa_cli. This happens when the connection failed using the WPS button or when I add a fake network without encryption:
network={
	ssid="MyNetwork"
}

At next startup, it fails with an error. I've found a bug report in archlinux that perfectly describes the case:
https://bugs.archlinux.org/task/18212

To avoid the problem, I quickly made a DIRTY hack, here is the patch:
Index: wpa_supplicant-0.7.3/wpa_supplicant/config_file.c
Index: wpa_supplicant-0.7.3/wpa_supplicant/config_file.c
===================================================================
--- wpa_supplicant-0.7.3.orig/wpa_supplicant/config_file.c
+++ wpa_supplicant-0.7.3/wpa_supplicant/config_file.c
@@ -105,6 +105,12 @@ static int wpa_config_validate_network(s
 		wpa_config_update_psk(ssid);
 	}
 
+        /** 
+         * Do not make error if PSK network as no key set. This to avoid an error at
+         * startup when wpa_supplicant update the configuration file and is not able
+         * to follow its own syntax!
+         **/
+        /*
 	if ((ssid->key_mgmt & (WPA_KEY_MGMT_PSK | WPA_KEY_MGMT_FT_PSK |
 			       WPA_KEY_MGMT_PSK_SHA256)) &&
 	    !ssid->psk_set) {
@@ -112,6 +118,7 @@ static int wpa_config_validate_network(s
 			   "management, but no PSK configured.", line);
 		errors++;
 	}
+        */
 
 	if ((ssid->group_cipher & WPA_CIPHER_CCMP) &&
 	    !(ssid->pairwise_cipher & WPA_CIPHER_CCMP) &&
===================================================================

It does some ioctl error at startup but at least the service is started... As it is said on archlinux bug report, it would be better to add the "security=NONE" directly when the configuration is saved...

Probably you already know that behavior but as it looks like it has not been corrected since last February, I thought it was a good idea to tell you. Should I also do a bug report ?

Regards,

Guy Morand




More information about the Hostap mailing list