hostapd: properly mark random data as ready if initialization succeeds without reasso...
[openwrt/openwrt.git] / package / hostapd / patches / 500-scan_wait.patch
index 02675e1781a9162881d2dfd03a4ad65872366ac5..7f1c749b35fb5141b59021b9c3c0cf1fec517ae0 100644 (file)
@@ -1,6 +1,6 @@
 --- a/src/ap/hostapd.h
 +++ b/src/ap/hostapd.h
-@@ -271,6 +271,7 @@ struct hostapd_iface {
+@@ -229,6 +229,7 @@ struct hostapd_iface {
        int (*for_each_interface)(struct hapd_interfaces *interfaces,
                                  int (*cb)(struct hostapd_iface *iface,
                                            void *ctx), void *ctx);
@@ -10,7 +10,7 @@
  /* hostapd.c */
 --- a/src/ap/hostapd.c
 +++ b/src/ap/hostapd.c
-@@ -784,6 +784,9 @@ int hostapd_setup_interface_complete(str
+@@ -790,6 +790,9 @@ int hostapd_setup_interface_complete(str
        wpa_printf(MSG_DEBUG, "%s: Setup of interface done.",
                   iface->bss[0]->conf->iface);
  
@@ -22,7 +22,7 @@
  
 --- a/hostapd/main.c
 +++ b/hostapd/main.c
-@@ -35,6 +35,8 @@
+@@ -36,6 +36,8 @@
  extern int wpa_debug_level;
  extern int wpa_debug_show_keys;
  extern int wpa_debug_timestamp;
@@ -31,7 +31,7 @@
  
  
  struct hapd_interfaces {
-@@ -162,6 +164,15 @@ static void hostapd_logger_cb(void *ctx,
+@@ -163,6 +165,15 @@ static void hostapd_logger_cb(void *ctx,
  }
  #endif /* CONFIG_NO_HOSTAPD_LOGGER */
  
@@ -47,7 +47,7 @@
  
  /**
   * hostapd_init - Allocate and initialize per-interface data
-@@ -183,6 +194,7 @@ static struct hostapd_iface * hostapd_in
+@@ -184,6 +195,7 @@ static struct hostapd_iface * hostapd_in
        if (hapd_iface == NULL)
                goto fail;
  
@@ -55,7 +55,7 @@
        hapd_iface->reload_config = hostapd_reload_config;
        hapd_iface->config_read_cb = hostapd_config_read;
        hapd_iface->config_fname = os_strdup(config_file);
-@@ -391,7 +403,7 @@ static int hostapd_global_init(struct ha
+@@ -399,7 +411,7 @@ static int hostapd_global_init(struct ha
  }
  
  
@@ -64,7 +64,7 @@
  {
  #ifdef EAP_SERVER_TNC
        tncs_global_deinit();
-@@ -409,8 +421,7 @@ static void hostapd_global_deinit(const 
+@@ -419,8 +431,7 @@ static void hostapd_global_deinit(const 
  }
  
  
@@ -74,7 +74,7 @@
  {
  #ifdef EAP_SERVER_TNC
        int tnc = 0;
-@@ -431,11 +442,6 @@ static int hostapd_global_run(struct hap
+@@ -441,11 +452,6 @@ static int hostapd_global_run(struct hap
        }
  #endif /* EAP_SERVER_TNC */
  
        eloop_run();
  
        return 0;
-@@ -479,8 +485,7 @@ int main(int argc, char *argv[])
+@@ -501,8 +507,7 @@ int main(int argc, char *argv[])
        struct hapd_interfaces interfaces;
        int ret = 1;
        size_t i;
 -      int c, debug = 0, daemonize = 0;
 -      char *pid_file = NULL;
 +      int c, debug = 0;
+       const char *log_file = NULL;
  
        if (os_program_init())
-               return -1;
-@@ -545,7 +550,7 @@ int main(int argc, char *argv[])
+@@ -576,7 +581,7 @@ int main(int argc, char *argv[])
                        goto out;
        }
  
                goto out;
  
        ret = 0;
-@@ -556,7 +561,7 @@ int main(int argc, char *argv[])
+@@ -587,7 +592,7 @@ int main(int argc, char *argv[])
                hostapd_interface_deinit_free(interfaces.iface[i]);
        os_free(interfaces.iface);
  
 +      hostapd_global_deinit();
        os_free(pid_file);
  
-       os_program_deinit();
+       if (log_file)
 --- a/hostapd/config_file.c
 +++ b/hostapd/config_file.c
-@@ -1882,6 +1882,8 @@ struct hostapd_config * hostapd_config_r
+@@ -1891,6 +1891,8 @@ struct hostapd_config * hostapd_config_r
                        }
  #endif /* CONFIG_IEEE80211W */
  #ifdef CONFIG_IEEE80211N
                } else if (os_strcmp(buf, "ht_capab") == 0) {
 --- a/src/ap/ap_config.h
 +++ b/src/ap/ap_config.h
-@@ -380,6 +380,7 @@ struct hostapd_config {
+@@ -389,6 +389,7 @@ struct hostapd_config {
  
        int ht_op_mode_fixed;
        u16 ht_capab;
 +      int noscan;
        int ieee80211n;
        int secondary_channel;
};
      int require_ht;
 --- a/src/ap/hw_features.c
 +++ b/src/ap/hw_features.c
-@@ -460,7 +460,7 @@ static int ieee80211n_check_40mhz(struct
+@@ -463,7 +463,7 @@ static int ieee80211n_check_40mhz(struct
  {
        struct wpa_driver_scan_params params;