net80211: prefix get_random_bytes() with net80211_

Both linux/random.h and net80211 have a function named
get_random_bytes().  With overlapping files included these collide.
Arguably the function could be renamed in linuxkpi but the generic
name should also not be used in net80211 so rename it there.

Sponsored-by:	The FreeBSD Foundation
MFC-after:	2 weeks
Reviewed-by:	philip, adrian
Differential Revision:	https://reviews.freebsd.org/D29335
This commit is contained in:
Bjoern A. Zeeb 2021-03-18 22:15:00 +00:00
parent efad9c8ba3
commit af7d9f8e31
7 changed files with 8 additions and 7 deletions

View File

@ -100,7 +100,7 @@ wep_attach(struct ieee80211vap *vap, struct ieee80211_key *k)
ctx->wc_vap = vap;
ctx->wc_ic = vap->iv_ic;
get_random_bytes(&ctx->wc_iv, sizeof(ctx->wc_iv));
net80211_get_random_bytes(&ctx->wc_iv, sizeof(ctx->wc_iv));
nrefs++; /* NB: we assume caller locking */
return ctx;
}

View File

@ -421,7 +421,7 @@ ieee80211_dfs_pickchannel(struct ieee80211com *ic)
* one at random (skipping channels where radar has
* been detected).
*/
get_random_bytes(&v, sizeof(v));
net80211_get_random_bytes(&v, sizeof(v));
v %= ic->ic_nchans;
for (i = v; i < ic->ic_nchans; i++) {
c = &ic->ic_channels[i];

View File

@ -749,7 +749,7 @@ ieee80211_vap_xmitpkt(struct ieee80211vap *vap, struct mbuf *m)
#include <sys/libkern.h>
void
get_random_bytes(void *p, size_t n)
net80211_get_random_bytes(void *p, size_t n)
{
uint8_t *dp = p;

View File

@ -359,7 +359,7 @@ struct ieee80211com;
int ieee80211_parent_xmitpkt(struct ieee80211com *, struct mbuf *);
int ieee80211_vap_xmitpkt(struct ieee80211vap *, struct mbuf *);
void get_random_bytes(void *, size_t);
void net80211_get_random_bytes(void *, size_t);
void ieee80211_sysctl_attach(struct ieee80211com *);
void ieee80211_sysctl_detach(struct ieee80211com *);

View File

@ -1093,7 +1093,7 @@ hostap_auth_shared(struct ieee80211_node *ni, struct ieee80211_frame *wh,
/* NB: don't return error so they rexmit */
return;
}
get_random_bytes(ni->ni_challenge,
net80211_get_random_bytes(ni->ni_challenge,
IEEE80211_CHALLENGE_LEN);
IEEE80211_NOTE(vap, IEEE80211_MSG_DEBUG | IEEE80211_MSG_AUTH,
ni, "shared key %sauth request", allocbs ? "" : "re");

View File

@ -962,7 +962,7 @@ mesh_generateid(struct ieee80211vap *vap)
uint16_t r;
do {
get_random_bytes(&r, 2);
net80211_get_random_bytes(&r, 2);
ieee80211_iterate_nodes(&vap->iv_ic->ic_sta, mesh_checkid, &r);
maxiter--;
} while (r == 0 && maxiter > 0);

View File

@ -363,7 +363,8 @@ ieee80211_create_ibss(struct ieee80211vap* vap, struct ieee80211_channel *chan)
if (vap->iv_flags & IEEE80211_F_DESBSSID)
IEEE80211_ADDR_COPY(ni->ni_bssid, vap->iv_des_bssid);
else {
get_random_bytes(ni->ni_bssid, IEEE80211_ADDR_LEN);
net80211_get_random_bytes(ni->ni_bssid,
IEEE80211_ADDR_LEN);
/* clear group bit, add local bit */
ni->ni_bssid[0] = (ni->ni_bssid[0] &~ 0x01) | 0x02;
}