mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-22 06:57:51 +00:00
wifi: check 'lx_get_mac_addr' before reporting
The MAC address device report should be published once the device is available. Since this may happen at a later time we have to check the call. Issue #4813
This commit is contained in:
parent
8ae5ae76fb
commit
0b08ae09c4
@ -487,12 +487,23 @@ extern "C" int socketcall_task_function(void *)
|
||||
static Lx::Socket inst(Lx_kit::env().env.ep());
|
||||
_socket = &inst;
|
||||
|
||||
_wifi_report_mac_address({ (void *) lx_get_mac_addr() });
|
||||
void const *mac_addr = nullptr;
|
||||
|
||||
wpa_blockade->wakeup();
|
||||
|
||||
while (true) {
|
||||
|
||||
/*
|
||||
* Try to report the MAC address once. We have to check
|
||||
* 'lx_get_mac_addr' as it might by NULL in case 'wlan0'
|
||||
* is not yet available.
|
||||
*/
|
||||
if (!mac_addr) {
|
||||
mac_addr = lx_get_mac_addr();
|
||||
if (mac_addr)
|
||||
_wifi_report_mac_address({ (void *) mac_addr });
|
||||
}
|
||||
|
||||
_socket->exec_call();
|
||||
|
||||
lx_emul_task_schedule(true);
|
||||
|
Loading…
Reference in New Issue
Block a user