Date: Mon, 12 Sep 2016 23:00:31 +0000 (UTC) From: Andriy Voskoboinyk <avos@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305757 - head/sys/net80211 Message-ID: <201609122300.u8CN0W88048599@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avos Date: Mon Sep 12 23:00:31 2016 New Revision: 305757 URL: https://svnweb.freebsd.org/changeset/base/305757 Log: net80211: fix possible panic in adhoc mode (INIT -> RUN state transition). In case if there is already running interface, a second non-sta interface will omit scanning, going directly to RUN state. Handle this case for adhoc mode appropriately. Tested with RTL8821AU, 2 vaps in IBSS mode. Modified: head/sys/net80211/ieee80211_adhoc.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Mon Sep 12 22:46:19 2016 (r305756) +++ head/sys/net80211/ieee80211_adhoc.c Mon Sep 12 23:00:31 2016 (r305757) @@ -215,6 +215,19 @@ adhoc_newstate(struct ieee80211vap *vap, /* XXX validate prerequisites */ } switch (ostate) { + case IEEE80211_S_INIT: + /* + * Already have a channel; bypass the + * scan and startup immediately. + * Note that ieee80211_create_ibss will call + * back to do a RUN->RUN state change. + */ + ieee80211_create_ibss(vap, + ieee80211_ht_adjust_channel(ic, + ic->ic_curchan, vap->iv_flags_ht)); + /* NB: iv_bss is changed on return */ + ni = vap->iv_bss; + break; case IEEE80211_S_SCAN: #ifdef IEEE80211_DEBUG if (ieee80211_msg_debug(vap)) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609122300.u8CN0W88048599>