From owner-svn-src-head@FreeBSD.ORG Tue Jul 31 07:22:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 74B8310657CC; Tue, 31 Jul 2012 07:22:51 +0000 (UTC) (envelope-from monthadar@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F8E88FC0A; Tue, 31 Jul 2012 07:22:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6V7MpfO099709; Tue, 31 Jul 2012 07:22:51 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6V7Mp43099707; Tue, 31 Jul 2012 07:22:51 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201207310722.q6V7Mp43099707@svn.freebsd.org> From: Monthadar Al Jaberi Date: Tue, 31 Jul 2012 07:22:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238938 - head/sys/dev/wtap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jul 2012 07:22:51 -0000 Author: monthadar Date: Tue Jul 31 07:22:50 2012 New Revision: 238938 URL: http://svn.freebsd.org/changeset/base/238938 Log: Fix wtap to not panic in wtap_beacon_intrp. * Changed KASSERT to be debug printf (DWTAP_PRINTF). If state is not IEEE80211_S_RUN we return without scheduling a new callout; * When net80211 stack changes state to IEEE802_11_INIT we stop the beacon callout task; Modified: head/sys/dev/wtap/if_wtap.c Modified: head/sys/dev/wtap/if_wtap.c ============================================================================== --- head/sys/dev/wtap/if_wtap.c Tue Jul 31 05:51:48 2012 (r238937) +++ head/sys/dev/wtap/if_wtap.c Tue Jul 31 07:22:50 2012 (r238938) @@ -230,8 +230,10 @@ wtap_beacon_intrp(void *arg) struct ieee80211vap *vap = arg; struct mbuf *m; - KASSERT(vap->iv_state >= IEEE80211_S_RUN, - ("not running, state %d", vap->iv_state)); + if (vap->iv_state < IEEE80211_S_RUN) { + DWTAP_PRINTF("Skip beacon, not running, state %d", vap->iv_state); + return ; + } DWTAP_PRINTF("[%d] beacon intrp\n", avp->id); //burst mode /* * Update dynamic beacon contents. If this returns @@ -289,6 +291,8 @@ wtap_newstate(struct ieee80211vap *vap, default: goto bad; } + } else if (nstate == IEEE80211_S_INIT) { + callout_stop(&avp->av_swba); } return 0; bad: