On Sun, Apr 29, 2018 at 12:13:37PM +0200, Jesper Wallin wrote:
> I've moved the check to ieee80211_input() now and it seems to work.
> However, when I set the bssid and it aborts the scan, the debug message
> of "end background scan" appears before the actual list of APs.

This diff doesn't look right. You'll want to prevent the timeout_add_msec()
call rather than timeout_del() since your goal is to avoid scheduling
the timeout in the first place. See 'man timeout_add'.
 
> Index: ieee80211_input.c
> ===================================================================
> RCS file: /cvs/src/sys/net80211/ieee80211_input.c,v
> retrieving revision 1.199
> diff -u -p -r1.199 ieee80211_input.c
> --- ieee80211_input.c 27 Apr 2018 17:03:09 -0000      1.199
> +++ ieee80211_input.c 29 Apr 2018 10:00:53 -0000
> @@ -270,7 +270,8 @@ ieee80211_input(struct ifnet *ifp, struc
>  
>               if (ic->ic_state == IEEE80211_S_RUN && ic->ic_bgscan_start) {
>                       /* Cancel or start background scan based on RSSI. */
> -                     if ((*ic->ic_node_checkrssi)(ic, ni))
> +                     if (ic->ic_flags & IEEE80211_F_DESBSSID ||
> +                         (*ic->ic_node_checkrssi)(ic, ni))
>                               timeout_del(&ic->ic_bgscan_timeout);
>                       else if (!timeout_pending(&ic->ic_bgscan_timeout) &&
>                           (ic->ic_flags & IEEE80211_F_BGSCAN) == 0)
> 

Reply via email to