3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-25 08:02:38 +01:00

monitor: Remove GENL_ID_GENERATE

Kernel v4.10 and later no longer export GENL_ID_GENERATE (which was
defined as 0). iwd was using this symbol to check for unmodified local
values rather than to ask for a dynamically generated netlink ID anyway,
so it makes sense to use the value 0 directly. This will work with
kernels before and after the GENL_ID_GENERATE change.
This commit is contained in:
Mat Martineau 2017-04-14 12:17:23 -07:00 committed by Denis Kenzior
parent 9a8ffc473a
commit 0e108f9727
2 changed files with 6 additions and 6 deletions

View File

@ -78,7 +78,7 @@ static void genl_parse(uint16_t type, const void *data, uint32_t len,
const struct genlmsghdr *genlmsg = data; const struct genlmsghdr *genlmsg = data;
const struct nlattr *nla; const struct nlattr *nla;
char name[GENL_NAMSIZ]; char name[GENL_NAMSIZ];
uint16_t id = GENL_ID_GENERATE; uint16_t id = 0;
if (nlmon) if (nlmon)
return; return;
@ -101,7 +101,7 @@ static void genl_parse(uint16_t type, const void *data, uint32_t len,
} }
} }
if (id == GENL_ID_GENERATE) if (id == 0)
return; return;
if (!strcmp(name, NL80211_GENL_NAME)) { if (!strcmp(name, NL80211_GENL_NAME)) {
@ -695,7 +695,7 @@ int main(int argc, char *argv[])
const char *analyze_path = NULL; const char *analyze_path = NULL;
const char *ifname = NULL; const char *ifname = NULL;
struct iwmon_interface monitor_interface = { }; struct iwmon_interface monitor_interface = { };
uint16_t nl80211_family = GENL_ID_GENERATE; uint16_t nl80211_family = 0;
struct l_signal *signal; struct l_signal *signal;
sigset_t mask; sigset_t mask;
int exit_status; int exit_status;
@ -733,7 +733,7 @@ int main(int argc, char *argv[])
} }
nl80211_family = strtoul(optarg, NULL, 10); nl80211_family = strtoul(optarg, NULL, 10);
} }
if (nl80211_family == GENL_ID_GENERATE) { if (nl80211_family == 0) {
usage(); usage();
return EXIT_FAILURE; return EXIT_FAILURE;
} }

View File

@ -4160,7 +4160,7 @@ static void genl_ctrl(struct nlmon *nlmon, const void *data, uint32_t len)
const struct genlmsghdr *genlmsg = data; const struct genlmsghdr *genlmsg = data;
const struct nlattr *nla; const struct nlattr *nla;
char name[GENL_NAMSIZ]; char name[GENL_NAMSIZ];
uint16_t id = GENL_ID_GENERATE; uint16_t id = 0;
if (genlmsg->cmd != CTRL_CMD_NEWFAMILY) if (genlmsg->cmd != CTRL_CMD_NEWFAMILY)
return; return;
@ -4177,7 +4177,7 @@ static void genl_ctrl(struct nlmon *nlmon, const void *data, uint32_t len)
} }
} }
if (id == GENL_ID_GENERATE) if (id == 0)
return; return;
if (!strcmp(name, NL80211_GENL_NAME)) if (!strcmp(name, NL80211_GENL_NAME))