Cannot connect to WPA and Open Network
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
netcfg (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Description: Ubuntu 20.04.3 LTS
Release: 20.04
netcfg version: 1.142ubuntu8
What you expected to happen:
Use oem-config debconf mode, in network configuration step, we can setup wifi network connection by choosing ESSID from ESSID list and entering WPA/WPA2 key.
What happened instead:
Choose an ESSID from ESSID list, then enter WPA/WPA2 key. Wait a moment, it showed the error 'Failure of key exchange and association'
If I change to enter ESSID manually and WPA/WPA2 key, it can connect to the ESSID successfully.
More information:
I traced netcfg source code which was downloaded from http://
I saw netcfg.c has defined the state machine in main loop. Depend on different state, the network interface will be up/down. For example, config a WPA wireless network and with DHCP method, I list the state flow, and the wlan0 status after this state as below:
1. GET_INTERFACE (wlan0 down)
2. WCONFIG (no change)
3. WCONFIG_ESSID (wlan0 is up first. If choose essid from the list, wlan0 will be down; if choose enter essid manually, wlan0 will keep up)
4. WCONFIG_
5. WCONFIG_WPA (no change)
6. START_WPA (no change)
7. GET_METHOD (no change)
8. GET_DHCP (wlan0 up)
The issue I encountered is choosing essid from the list, wlan0 will be down, so I could see the below errors in syslog during START_WPA state:
Dec 2 04:37:11 localhost netcfg[8076]: INFO: buf = wpa_state=
Dec 2 04:37:51 localhost netcfg[8076]: message repeated 8 times: [ INFO: buf = wpa_state=
Dec 2 04:37:53 localhost wpa_supplicant[
And this causes the configuration is failed. But if I choose enter essid manually, it will be successful because wlan0 keeps up during START_WPA state.
My first question is: Why not keeping the wlan0 is up for both use cases because it needs to send commands to wpa_supplicant daemon during START_WPA state?
Another example is setting Open Network. I choose ‘Open Network’ and left wep key as blank. From syslog, I didn’t see the association with access point during WCONFIG_WEP state. Is this expected?
It will be failed due to wlan is carrier down:
Dec 2 05:22:48 localhost netcfg[6898]: DEBUG: State is now 0
Dec 2 05:22:48 localhost netcfg[6898]: DEBUG: Want link on wlan0
Dec 2 05:22:48 localhost netcfg[6898]: INFO: Waiting time set to 3
Dec 2 05:22:49 localhost netcfg[6898]: INFO: ethtool-lite: wlan0: carrier down
Dec 2 05:22:50 localhost netcfg[6898]: message repeated 5 times: [ INFO: ethtool-lite: wlan0: carrier down]
My second question is: Is this expected without association with access point before doing DHCPDISCOVER?