mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-23 04:14:07 +01:00
monitor: Terminate program when setup of netlink monitor failed
This commit is contained in:
parent
70bc082d41
commit
b5b292ee25
@ -81,8 +81,11 @@ static void genl_parse(uint16_t type, const void *data, uint32_t len,
|
||||
if (id == GENL_ID_GENERATE)
|
||||
return;
|
||||
|
||||
if (!strcmp(name, NL80211_GENL_NAME))
|
||||
if (!strcmp(name, NL80211_GENL_NAME)) {
|
||||
nlmon = nlmon_open(ifname, id);
|
||||
if (!nlmon)
|
||||
l_main_quit();
|
||||
}
|
||||
}
|
||||
|
||||
static void genl_notify(uint16_t type, const void *data,
|
||||
|
@ -1182,11 +1182,16 @@ static struct l_io *open_packet(const char *name)
|
||||
struct nlmon *nlmon_open(const char *ifname, uint16_t id)
|
||||
{
|
||||
struct nlmon *nlmon;
|
||||
struct l_io *io;
|
||||
|
||||
io = open_packet(ifname);
|
||||
if (!io)
|
||||
return NULL;
|
||||
|
||||
nlmon = l_new(struct nlmon, 1);
|
||||
|
||||
nlmon->id = id;
|
||||
nlmon->io = open_packet(ifname);
|
||||
nlmon->io = io;
|
||||
nlmon->req_list = l_queue_new();
|
||||
|
||||
l_io_set_read_handler(nlmon->io, nlmon_receive, nlmon, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user