summaryrefslogtreecommitdiff
path: root/sys/net80211
diff options
context:
space:
mode:
authorPeter Hessler <phessler@cvs.openbsd.org>2018-10-27 09:55:27 +0000
committerPeter Hessler <phessler@cvs.openbsd.org>2018-10-27 09:55:27 +0000
commited762afc39239c3789626270f37ce81809f58d5a (patch)
tree65967d30c3651f3c4c6bcb93f317c5bff5207029 /sys/net80211
parent2e545618f094f8bac4a65ec6f65462deb8101ebe (diff)
clean up accounting of the AUTO_JOIN flag by making sure it is set or cleared
based on the state of the joinlist OK stsp@
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211_ioctl.c4
-rw-r--r--sys/net80211/ieee80211_node.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c
index fa2cb09259e..500a5306b06 100644
--- a/sys/net80211/ieee80211_ioctl.c
+++ b/sys/net80211/ieee80211_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_ioctl.c,v 1.67 2018/09/10 11:07:43 phessler Exp $ */
+/* $OpenBSD: ieee80211_ioctl.c,v 1.68 2018/10/27 09:55:26 phessler Exp $ */
/* $NetBSD: ieee80211_ioctl.c,v 1.15 2004/05/06 02:58:16 dyoung Exp $ */
/*-
@@ -434,7 +434,7 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
if (ic->ic_des_esslen > 0) {
/* 'nwid' disables auto-join magic */
ic->ic_flags &= ~IEEE80211_F_AUTO_JOIN;
- } else {
+ } else if (!TAILQ_EMPTY(&ic->ic_ess)) {
/* '-nwid' re-enables auto-join */
ic->ic_flags |= IEEE80211_F_AUTO_JOIN;
}
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index d7b941cf9c6..9f485c0e6cb 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_node.c,v 1.153 2018/10/27 09:47:36 phessler Exp $ */
+/* $OpenBSD: ieee80211_node.c,v 1.154 2018/10/27 09:55:26 phessler Exp $ */
/* $NetBSD: ieee80211_node.c,v 1.14 2004/05/09 09:18:47 dyoung Exp $ */
/*-
@@ -201,6 +201,8 @@ ieee80211_del_ess(struct ieee80211com *ic, char *nwid, int all)
TAILQ_REMOVE(&ic->ic_ess, ess, ess_next);
explicit_bzero(ess, sizeof(*ess));
free(ess, M_DEVBUF, sizeof(*ess));
+ if (TAILQ_EMPTY(&ic->ic_ess))
+ ic->ic_flags &= ~IEEE80211_F_AUTO_JOIN;
if (all != 1)
return;
}