Hi all,

I recently learned that my AP behaves badly and I have packet loss when
the background scan is running.  I had a small chat with stsp@ about it,
asking if there is a way to disable it.  He kindly explained that if I'm
connected to an AP with a weak signal, it will try to find another AP
with better signal and use that one instead.

Sadly, I only have a single AP at home and this doesn't really solve my
problem.  Though, you can also set a desired bssid to use, to force it
to connect to a single AP.  However, the background scan will still run
even if this is set.

Maybe the background scan has other use-cases that I'm not aware of, if
so, I apologize in advance.  The patch below simply check if a bssid is
specified and if so, skip the background scan.


Regards,
Jesper Wallin


Index: ieee80211.c
===================================================================
RCS file: /cvs/src/sys/net80211/ieee80211.c,v
retrieving revision 1.68
diff -u -p -r1.68 ieee80211.c
--- ieee80211.c 28 Apr 2018 14:49:07 -0000      1.68
+++ ieee80211.c 29 Apr 2018 00:55:43 -0000
@@ -80,6 +80,14 @@ ieee80211_begin_bgscan(struct ifnet *ifp
            ic->ic_state != IEEE80211_S_RUN)
                return;
 
+       if (ic->ic_flags & IEEE80211_F_DESBSSID) {
+               if (ifp->if_flags & IFF_DEBUG) {
+                       printf("%s: skipping background scan (bssid is set)\n",
+                           ifp->if_xname);
+               }
+               return;
+       }
+
        if (ic->ic_bgscan_start != NULL && ic->ic_bgscan_start(ic) == 0) {
                /*
                 * Free the nodes table to ensure we get an up-to-date view

Reply via email to