hostapd: Add UDP support for ctrl_iface
[mech_eap.git] / hostapd / main.c
index 4913cbd..6c4e195 100644 (file)
@@ -408,9 +408,16 @@ static int hostapd_global_run(struct hapd_interfaces *ifaces, int daemonize,
        }
 #endif /* EAP_SERVER_TNC */
 
-       if (daemonize && os_daemonize(pid_file)) {
-               wpa_printf(MSG_ERROR, "daemon: %s", strerror(errno));
-               return -1;
+       if (daemonize) {
+               if (os_daemonize(pid_file)) {
+                       wpa_printf(MSG_ERROR, "daemon: %s", strerror(errno));
+                       return -1;
+               }
+               if (eloop_sock_requeue()) {
+                       wpa_printf(MSG_ERROR, "eloop_sock_requeue: %s",
+                                  strerror(errno));
+                       return -1;
+               }
        }
 
        eloop_run();
@@ -586,7 +593,7 @@ int main(int argc, char *argv[])
        interfaces.global_iface_path = NULL;
        interfaces.global_iface_name = NULL;
        interfaces.global_ctrl_sock = -1;
-       interfaces.global_ctrl_dst = NULL;
+       dl_list_init(&interfaces.global_ctrl_dst);
 
        for (;;) {
                c = getopt(argc, argv, "b:Bde:f:hKP:STtu:vg:G:");