module/network: generate nl80211 sequence number from /dev/urandom

This commit is contained in:
Daniel Eklöf 2022-08-28 20:36:12 +02:00
parent 6427e8213c
commit d002919bad
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -442,7 +442,12 @@ send_nl80211_get_station(struct private *m)
LOG_DBG("%s: sending nl80211 get-station request", m->iface);
uint32_t seq = time(NULL);
uint32_t seq;
if (read(m->urandom_fd, &seq, sizeof(seq)) != sizeof(seq)) {
LOG_ERRNO("failed to read from /dev/urandom");
return false;
}
if (send_nl80211_request(
m, NL80211_CMD_GET_STATION, NLM_F_REQUEST | NLM_F_DUMP, seq))
{