From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 23:51:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 403C01065691; Tue, 10 Feb 2009 23:51:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28AB58FC1D; Tue, 10 Feb 2009 23:51:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ANpJDs007951; Tue, 10 Feb 2009 23:51:19 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ANpJeK007950; Tue, 10 Feb 2009 23:51:19 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902102351.n1ANpJeK007950@svn.freebsd.org> From: Sam Leffler Date: Tue, 10 Feb 2009 23:51:19 +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: r188466 - head/sys/net80211 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, 10 Feb 2009 23:51:21 -0000 Author: sam Date: Tue Feb 10 23:51:18 2009 New Revision: 188466 URL: http://svn.freebsd.org/changeset/base/188466 Log: clean neighbor entries on beacon miss Modified: head/sys/net80211/ieee80211_adhoc.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Tue Feb 10 23:48:29 2009 (r188465) +++ head/sys/net80211/ieee80211_adhoc.c Tue Feb 10 23:51:18 2009 (r188466) @@ -110,6 +110,15 @@ adhoc_vattach(struct ieee80211vap *vap) #endif } +static void +sta_leave(void *arg, struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = arg; + + if (ni->ni_vap == vap && ni != vap->iv_bss) + ieee80211_node_leave(ni); +} + /* * IEEE80211_M_IBSS+IEEE80211_M_AHDEMO vap state machine handler. */ @@ -146,8 +155,11 @@ adhoc_newstate(struct ieee80211vap *vap, break; case IEEE80211_S_SCAN: switch (ostate) { - case IEEE80211_S_INIT: case IEEE80211_S_RUN: /* beacon miss */ + /* purge station table; entries are stale */ + ieee80211_iterate_nodes(&ic->ic_sta, sta_leave, vap); + /* fall thru... */ + case IEEE80211_S_INIT: if (vap->iv_des_chan != IEEE80211_CHAN_ANYC && !IEEE80211_IS_CHAN_RADAR(vap->iv_des_chan)) { /*