diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2018-08-06 09:34:18 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2018-08-06 09:34:18 +0000 |
commit | 2f9ac048c224e8b785cddc55c0590b34b8808a36 (patch) | |
tree | 1c8a7e9030b93cc870e0f37804016b0a79bcccb6 /sys | |
parent | 281b13de240a233b4d3bde4ea75741a83b33f254 (diff) |
Do not set nwid over and over again. We just found the ess by comparing
the nwid. It will not have changed in the meantime.
OK stsp
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net80211/ieee80211_node.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index d4561bffc06..434bec3001c 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_node.c,v 1.136 2018/08/03 10:52:45 phessler Exp $ */ +/* $OpenBSD: ieee80211_node.c,v 1.137 2018/08/06 09:34:17 florian Exp $ */ /* $NetBSD: ieee80211_node.c,v 1.14 2004/05/09 09:18:47 dyoung Exp $ */ /*- @@ -229,11 +229,10 @@ ieee80211_add_ess(struct ieee80211com *ic, char *nwid, int wpa, int wep) ess = malloc(sizeof(*ess), M_DEVBUF, M_NOWAIT|M_ZERO); if (ess == NULL) return (ENOMEM); + memcpy(ess->essid, nwid, ic->ic_des_esslen); + ess->esslen = ic->ic_des_esslen; } - memcpy(ess->essid, nwid, ic->ic_des_esslen); - ess->esslen = ic->ic_des_esslen; - if (wpa) { if (ic->ic_flags & (IEEE80211_F_RSNON|IEEE80211_F_PSK)) { ess->flags = IEEE80211_F_RSNON; |