From 9f0d6530b5ddda39865a032adf7fa403c5cc6d2b Mon Sep 17 00:00:00 2001 From: stsp Date: Tue, 13 Jan 2015 23:16:59 +0000 Subject: [PATCH] In IBSS mode, stop calling the driver's newassoc() each time a probe response is received from a node. Only call it once when the node is initially discovered, as used to be the case before r1.4 of this file. Asking the driver to set up its per-node private state once is enough. Also remove an outdated comment. ok sthen deraadt jsg --- sys/net80211/ieee80211_input.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index 4bbd9f13266..c340b200852 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_input.c,v 1.128 2014/12/23 03:24:08 tedu Exp $ */ +/* $OpenBSD: ieee80211_input.c,v 1.129 2015/01/13 23:16:59 stsp Exp $ */ /*- * Copyright (c) 2001 Atsushi Onoe @@ -1633,18 +1633,8 @@ ieee80211_recv_probe_resp(struct ieee80211com *ic, struct mbuf *m, /* NB: must be after ni_chan is setup */ ieee80211_setup_rates(ic, ni, rates, xrates, IEEE80211_F_DOSORT); - /* - * When scanning we record results (nodes) with a zero - * refcnt. Otherwise we want to hold the reference for - * ibss neighbors so the nodes don't get released prematurely. - * Anything else can be discarded (XXX and should be handled - * above so we don't do so much work). - */ - if ( #ifndef IEEE80211_STA_ONLY - ic->ic_opmode == IEEE80211_M_IBSS || -#endif - (is_new && isprobe)) { + if (ic->ic_opmode == IEEE80211_M_IBSS && is_new && isprobe) { /* * Fake an association so the driver can setup it's * private state. The rate set has been setup above; @@ -1653,6 +1643,7 @@ ieee80211_recv_probe_resp(struct ieee80211com *ic, struct mbuf *m, if (ic->ic_newassoc) (*ic->ic_newassoc)(ic, ni, 1); } +#endif } #ifndef IEEE80211_STA_ONLY -- 2.20.1