3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 06:29:23 +01:00

hwsim: Exit hwsim if MAC80211_HWSIM vanishes

If the MAC80211_HWSIM netlink family disappears, exit hwsim. This can
happen already at startup, for example if MAC80211_HWSIM functionality is
not compiled in the kernel or respective module loaded.
This commit is contained in:
Patrik Flykt 2014-10-27 15:01:20 +02:00 committed by Denis Kenzior
parent ab84f2dbe4
commit c2a140382a

View File

@ -183,6 +183,12 @@ static void hwsim_ready(void *user_data)
l_main_quit(); l_main_quit();
} }
static void hwsim_disappeared(void *user_data)
{
l_info("MAC80211_HWSIM missing");
l_main_quit();
}
static void signal_handler(struct l_signal *signal, uint32_t signo, static void signal_handler(struct l_signal *signal, uint32_t signo,
void *user_data) void *user_data)
{ {
@ -294,7 +300,8 @@ int main(int argc, char *argv[])
goto done; goto done;
} }
l_genl_family_set_watches(hwsim, hwsim_ready, NULL, NULL, NULL); l_genl_family_set_watches(hwsim, hwsim_ready, hwsim_disappeared,
NULL, NULL);
l_main_run(); l_main_run();