hostapd: fix encrypted mesh channel settings
[oweals/openwrt.git] / package / network / services / hostapd / patches / 470-survey_data_fallback.patch
1 --- a/src/ap/acs.c
2 +++ b/src/ap/acs.c
3 @@ -292,18 +292,12 @@ static void acs_fail(struct hostapd_ifac
4  static long double
5  acs_survey_interference_factor(struct freq_survey *survey, s8 min_nf)
6  {
7 -       long double factor, busy, total;
8 +       long double factor, busy = 0, total;
9  
10         if (survey->filled & SURVEY_HAS_CHAN_TIME_BUSY)
11                 busy = survey->channel_time_busy;
12         else if (survey->filled & SURVEY_HAS_CHAN_TIME_RX)
13                 busy = survey->channel_time_rx;
14 -       else {
15 -               /* This shouldn't really happen as survey data is checked in
16 -                * acs_sanity_check() */
17 -               wpa_printf(MSG_ERROR, "ACS: Survey data missing");
18 -               return 0;
19 -       }
20  
21         total = survey->channel_time;
22  
23 @@ -392,20 +386,19 @@ static int acs_usable_vht80_chan(struct
24  static int acs_survey_is_sufficient(struct freq_survey *survey)
25  {
26         if (!(survey->filled & SURVEY_HAS_NF)) {
27 +               survey->nf = -95;
28                 wpa_printf(MSG_INFO, "ACS: Survey is missing noise floor");
29 -               return 0;
30         }
31  
32         if (!(survey->filled & SURVEY_HAS_CHAN_TIME)) {
33 +               survey->channel_time = 0;
34                 wpa_printf(MSG_INFO, "ACS: Survey is missing channel time");
35 -               return 0;
36         }
37  
38         if (!(survey->filled & SURVEY_HAS_CHAN_TIME_BUSY) &&
39             !(survey->filled & SURVEY_HAS_CHAN_TIME_RX)) {
40                 wpa_printf(MSG_INFO,
41                            "ACS: Survey is missing RX and busy time (at least one is required)");
42 -               return 0;
43         }
44  
45         return 1;