aboutsummaryrefslogtreecommitdiff
path: root/package/network/services/hostapd/patches/470-survey_data_fallback.patch
blob: 1ae2c599ebb0a73254554f3e68d15365d4139d14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From: Felix Fietkau <nbd@nbd.name>
Date: Wed, 15 Jun 2016 17:31:48 +0200
Subject: [PATCH] hostapd: implement fallback for incomplete survey data

--- a/src/ap/acs.c
+++ b/src/ap/acs.c
@@ -467,17 +467,17 @@ static int acs_get_bw_center_chan(int fr
 static int acs_survey_is_sufficient(struct freq_survey *survey)
 {
 	if (!(survey->filled & SURVEY_HAS_NF)) {
+		survey->nf = -95;
 		wpa_printf(MSG_INFO,
 			   "ACS: Survey for freq %d is missing noise floor",
 			   survey->freq);
-		return 0;
 	}
 
 	if (!(survey->filled & SURVEY_HAS_CHAN_TIME)) {
+		survey->channel_time = 0;
 		wpa_printf(MSG_INFO,
 			   "ACS: Survey for freq %d is missing channel time",
 			   survey->freq);
-		return 0;
 	}
 
 	if (!(survey->filled & SURVEY_HAS_CHAN_TIME_BUSY) &&
@@ -485,7 +485,6 @@ static int acs_survey_is_sufficient(stru
 		wpa_printf(MSG_INFO,
 			   "ACS: Survey for freq %d is missing RX and busy time (at least one is required)",
 			   survey->freq);
-		return 0;
 	}
 
 	return 1;