I found some issues, so I am tracing netcfg source code which is downloaded from http://archive.ubuntu.com/ubuntu/pool/main/n/netcfg/netcfg_1.142ubuntu7.tar.xz.
I have some questions about the netcfg code flow, so I hope you can help to answer/explain for them.
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:
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: INFO: buf = wpa_state=INTERFACE_DISABLED#012address=00:16:01:80:8a:47#012uuid=c9148e48-dd38-516c-80e
Dec 2 04:37:51 localhost netcfg: message repeated 8 times: [ INFO: buf = wpa_state=INTERFACE_DISABLED#012address=00:16:01:80:8a:47#0]
Dec 2 04:37:53 localhost wpa_supplicant: wlan0: CTRL-EVENT-SCAN-FAILED ret=-100
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: DEBUG: State is now 0
Dec 2 05:22:48 localhost netcfg: DEBUG: Want link on wlan0
Dec 2 05:22:48 localhost netcfg: INFO: Waiting time set to 3
Dec 2 05:22:49 localhost netcfg: INFO: ethtool-lite: wlan0: carrier down
Dec 2 05:22:50 localhost netcfg: 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?
NOTE: I tried to sync and build the latest source from https://anonscm.debian.org/git/d-i/netcfg.git, but I could still encounter the same issues.
Information of my environment:
$ lshw -C network
$ lsb_release -a
Distributor ID: Ubuntu
$ uname -a
Linux localhost.localdomain 4.9.140-tegra #7 SMP PREEMPT Thu Nov 28 14:01:51 CST 2019 aarch64 aarch64 aarch64 GNU/Linux
Thanks a lot.
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.