hostapd: update to version 2013-11-20
[openwrt/openwrt.git] / package / network / services / hostapd / patches / 490-scan_wait.patch
1 --- a/hostapd/main.c
2 +++ b/hostapd/main.c
3 @@ -33,6 +33,8 @@
4 extern int wpa_debug_level;
5 extern int wpa_debug_show_keys;
6 extern int wpa_debug_timestamp;
7 +static int daemonize = 0;
8 +static char *pid_file = NULL;
9
10 extern struct wpa_driver_ops *wpa_drivers[];
11
12 @@ -147,6 +149,14 @@ static void hostapd_logger_cb(void *ctx,
13 }
14 #endif /* CONFIG_NO_HOSTAPD_LOGGER */
15
16 +static void hostapd_setup_complete_cb(void *ctx)
17 +{
18 + if (daemonize && os_daemonize(pid_file)) {
19 + perror("daemon");
20 + return;
21 + }
22 + daemonize = 0;
23 +}
24
25 /**
26 * hostapd_driver_init - Preparate driver interface
27 @@ -165,6 +175,8 @@ static int hostapd_driver_init(struct ho
28 return -1;
29 }
30
31 + hapd->setup_complete_cb = hostapd_setup_complete_cb;
32 +
33 /* Initialize the driver interface */
34 if (!(b[0] | b[1] | b[2] | b[3] | b[4] | b[5]))
35 b = NULL;
36 @@ -381,8 +393,6 @@ static void hostapd_global_deinit(const
37 #endif /* CONFIG_NATIVE_WINDOWS */
38
39 eap_server_unregister_methods();
40 -
41 - os_daemonize_terminate(pid_file);
42 }
43
44
45 @@ -408,11 +418,6 @@ static int hostapd_global_run(struct hap
46 }
47 #endif /* EAP_SERVER_TNC */
48
49 - if (daemonize && os_daemonize(pid_file)) {
50 - perror("daemon");
51 - return -1;
52 - }
53 -
54 eloop_run();
55
56 return 0;
57 @@ -521,8 +526,7 @@ int main(int argc, char *argv[])
58 struct hapd_interfaces interfaces;
59 int ret = 1;
60 size_t i, j;
61 - int c, debug = 0, daemonize = 0;
62 - char *pid_file = NULL;
63 + int c, debug = 0;
64 const char *log_file = NULL;
65 const char *entropy_file = NULL;
66 char **bss_config = NULL, **tmp_bss;