On Fri, Jan 10, 2020 at 12:52:44PM +0300, Consus wrote:
> On 20:06 Thu 09 Jan, Marc Espie wrote:
> > It's been that way for ages. But no-one volunteered
> > to work on this.
> 
> Anyone even knows about this? Aside from OpenBSD developers (who have
> their plates full already) how an average person can find out that there
> is rusty piece of code that should be taken care of?

Don't start looking at other people's problems before you can help yourself.
Rewriting automounter for Theo as a first contribution is not likely to work.
Find something small that annoys *you* and get involved by fixing that first.
Learn how to approach and debug issues that affect you directly.

How did I get into OpenBSD wifi?
Because my OpenBSD access point stopped accepting new associations after
one about week of usage. It turned out this was one of those problems
which had been known for years and all this time people had been switching
to non-OpenBSD APs to work around it. I had lived with the problem for
about a year or two, resetting the wifi interface on the AP whenever it
happened.

Then I noticed that 'ifconfig ath0 scan' showed a very long list of known
MAC addresses whenever the problem occurred. So I looked for a way trigger
the problem faster than in one week and succeeded by running this loop
on the client which made the problem appear after a few minutes:

  ifconfig iwn0 up
  while sleep 5; do ifconfig iwn0 lladdr random; done

Looking at the code I found that known MACs never expired! Once the AP had
reached its limit of learned MACs it accepted no new associations because
no room was made for new MAC addresses. Fix was a 3-line diff, which I
could verify with my above test.

-----------------------------------------------
commit 6bbde753957f0b27c56cfdd15c9af836579d120b
from: stsp <s...@openbsd.org>
date: Wed Jan 18 14:35:34 2012 UTC
 
 Make it possible to free cached nodes which never associated (e.g. nodes
 only scanning for networks). These were never put into COLLECT state and
 were thus never evicted from the node cache in hostap mode.
 ok jsg@
 
diff ae44467745d21c295e8ffe38340d662269578502 
d62cb122bc6abf011c13400ea5c3f90c56292854
blob - 893de460bfd2a1509205c4e5d837ba6f8d5c2636
blob + 9435a287862a29a9dc79ea09ce8328b8e054c819
--- sys/net80211/ieee80211_node.c
+++ sys/net80211/ieee80211_node.c
@@ -1507,8 +1507,10 @@ ieee80211_node_leave(struct ieee80211com *ic, struct i
         * If node wasn't previously associated all we need to do is
         * reclaim the reference.
         */
-       if (ni->ni_associd == 0)
+       if (ni->ni_associd == 0) {
+               ieee80211_node_newstate(ni, IEEE80211_STA_COLLECT);
                return;
+       }
 
        if (ni->ni_pwrsave == IEEE80211_PS_DOZE)
                ic->ic_pssta--;

Reply via email to