Commit Graph

20 Commits (vlan_per_psk)

Author SHA1 Message Date
Jouni Malinen 9d6eaad6b8 bgscan: Remove unnecessary NULL check
bgscan_init() is the only caller for the init() function and the
parameters argument is never NULL.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years ago
Jouni Malinen d85e1fc8a5 Check os_snprintf() result more consistently - automatic 1
This converts os_snprintf() result validation cases to use
os_snprintf_error() where the exact rule used in os_snprintf_error() was
used. These changes were done automatically with spatch using the
following semantic patch:

@@
identifier E1;
expression E2,E3,E4,E5,E6;
statement S1;
@@

(
  E1 = os_snprintf(E2, E3, ...);
|
  int E1 = os_snprintf(E2, E3, ...);
|
  if (E5)
	E1 = os_snprintf(E2, E3, ...);
  else
	E1 = os_snprintf(E2, E3, ...);
|
  if (E5)
	E1 = os_snprintf(E2, E3, ...);
  else if (E6)
	E1 = os_snprintf(E2, E3, ...);
  else
	E1 = 0;
|
  if (E5) {
	...
	E1 = os_snprintf(E2, E3, ...);
  } else {
	...
	return -1;
  }
|
  if (E5) {
	...
	E1 = os_snprintf(E2, E3, ...);
  } else if (E6) {
	...
	E1 = os_snprintf(E2, E3, ...);
  } else {
	...
	return -1;
  }
|
  if (E5) {
	...
	E1 = os_snprintf(E2, E3, ...);
  } else {
	...
	E1 = os_snprintf(E2, E3, ...);
  }
)
? os_free(E4);
- if (E1 < 0 || \( E1 >= E3 \| (size_t) E1 >= E3 \| (unsigned int) E1 >= E3 \| E1 >= (int) E3 \))
+ if (os_snprintf_error(E3, E1))
(
  S1
|
{ ... }
)

Signed-off-by: Jouni Malinen <j@w1.fi>
10 years ago
Johannes Berg e72a001b0f bgscan: Use monotonic time
The bgscan simple and learn algorithms should run regardless
of wall clock time jumps, so make them use monotonic time.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
11 years ago
Eliad Peller 3e06180fe0 bgscan_learn: Start scanning from the first freq
bgscan_learn_get_probe_freq() starts from returning the second entry in
the supp_freqs arrays. Change its logic a bit to make it start from the
first entry.

Signed-hostap: Eliad Peller <eliad@wizery.com>
11 years ago
Eyal Shapira f4c73ae640 bgscan_learn: Fix initial interval
In case the initial signal level of the associated BSS was above the
given threshold, bgscan_learn module would begin using the
short_interval but never switch to the long_interval as there would be
no signal change event. Make the init code poll for the current signal
level and set scan_interval accordingly. This logic exists in
bgscan_simple but was missing in bgscan_learn.

Signed-hostap: Eyal Shapira <eyal@wizery.com>
11 years ago
Eliad Peller 7dab119380 bgscan_learn: Avoid redundant frequencies
Some hw modes (e.g., 11b and 11g) contain the same frequencies,
causing the supp_freqs array to be populated with redundant entries.

Check for the existence of the freq before adding it.

Signed-hostap: Eliad Peller <eliad@wizery.com>
11 years ago
Pawel Kulakowski 548f100384 bgscan_learn: Prevent infinite busy looping
In highly congested network (BSSes almost on every channel
within ESS) we have hit a bug when wpa_supplicant become
completly irresponsive, infinite looping on while loop.

When probe_idx was equal 0 and we are not able to probe
new frequency, following condition were never fulfilled:
"if (!in_array(freqs, data->supp_freqs[idx]))"

Signed-hostap: Pawel Kulakowski <pawel.kulakowski@tieto.com>
12 years ago
Jouni Malinen 067ffa2696 Convert os_realloc() for an array to use os_realloc_array()
Signed-hostap: Jouni Malinen <j@w1.fi>
12 years ago
Jouni Malinen 0f3d578efc Remove the GPL notification from files contributed by Jouni Malinen
Remove the GPL notification text from the files that were
initially contributed by myself.

Signed-hostap: Jouni Malinen <j@w1.fi>
12 years ago
Christian Lamparter 6bf731e8ce wpa_supplicant: Unify hardware feature data
The hardware feature data is required in several different places
throughout the code. Previously, the data was acquired and freed on
demand, but with this patch wpa_supplicant will keep a single copy
around at runtime for everyone to use.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
13 years ago
Paul Stewart 174fa7898e bgscan: Add new channel condition parameters to signal change events
bgscan modules can potentially get a richer feel for the channel
condition and make better choices about scan/no-scan and roam/no-roam.
14 years ago
Jouni Malinen 266c828e54 bgscan learn: Fix build
Commit 9ff80a10e8 forgot to include the
new scan variable in the coded copied from bgscan_simple.c. Add that
here to fix the build.
14 years ago
Jouni Malinen 9ff80a10e8 bgscan learn: Skip immediate scan on initial signal event
The driver is likely to indicate an immediate signal event when the
threshold value is configured. Since we do this immediately after
association, there is not much point in requesting a new scan to be
started based on this event.
14 years ago
Jouni Malinen 60a972a68d Add current signal strength into signal quality change events 14 years ago
Jouni Malinen 79614ec55b bgscan learn: Remove forgotten debug printf 14 years ago
Jouni Malinen 3b7442e5fe bgscan learn: Mark BSSes that show up in the same scan as neighbors 14 years ago
Jouni Malinen 2e2a8d073d bgscan learn: Probe one new channel at a time to find APs
This allows APs to be found from channels that have not previously
been observed to contain APs for this ESS.
14 years ago
Jouni Malinen fc480e88bf bgscan learn: Learn BSS information based on previous scans
Store list of all discovered BSSes in the ESS and on which frequencies
they have been seen. Use this information to dynamically generated the
list of channels for background scans.
14 years ago
Jouni Malinen 2e8d6ae32e bgscan learn: Add data file for storing learned network information 14 years ago
Jouni Malinen c4d71c2505 bgscan: Add starting point for more advanced bgscan module: learn
This is based on the bgscan "simple" module and this initial commit
does not add any new functionality.
14 years ago