[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[[RFC] Netcfg add WPA support 3/4] Add WPA support to netcfg



Add wpa.c and killwpa.sh

Add security type and passphrase functions.

Remove the nested satan machine, replacing it with a reconfigure_wifi function. Add support for wpa.

Add wpa support in netcfg.

add our functions to the header file.

Once again, add our wpa related stuff.

make dirs for wpasupplicant, and install wpakill.sh

make sure our conf file gets copied over.

we need wpa support when we are manually configuring too.

Fix errant semicolen.

Forgot to change some constants and edit the makefile

add a forgotten int.

Clean up set_passphrase function.

Change wep to WEP in template.

Clean up some whitespace errors and general formatting problems.
---
 packages/netcfg/Makefile                       |    4 +-
 packages/netcfg/base-installer                 |    2 +-
 packages/netcfg/debian/netcfg-common.templates |   21 ++++++
 packages/netcfg/debian/rules                   |    5 +-
 packages/netcfg/dhcp.c                         |   86 +++++++++++++++---------
 packages/netcfg/killwpa.sh                     |   16 +++++
 packages/netcfg/netcfg-static.c                |   45 ++++++++++---
 packages/netcfg/netcfg.c                       |   66 +++++++++++++-----
 packages/netcfg/netcfg.h                       |   13 +++-
 packages/netcfg/wireless.c                     |   64 ++++++++++++++++++
 packages/netcfg/wpa.c                          |   81 ++++++++++++++++++++++
 11 files changed, 336 insertions(+), 67 deletions(-)
 create mode 100755 packages/netcfg/killwpa.sh
 create mode 100644 packages/netcfg/wpa.c

diff --git a/packages/netcfg/Makefile b/packages/netcfg/Makefile
index 4753350..15d2f67 100644
--- a/packages/netcfg/Makefile
+++ b/packages/netcfg/Makefile
@@ -17,8 +17,8 @@ endif
 
 all: $(TARGETS)
 
-netcfg-static: netcfg-static.o static.o
-netcfg: netcfg.o dhcp.o static.o ethtool-lite.o
+netcfg-static: netcfg-static.o static.o wpa.o
+netcfg: netcfg.o dhcp.o static.o ethtool-lite.o wpa.o
 
 $(TARGETS): $(COMMON_OBJS)
 	$(CC) -o $@ $^ $(LDOPTS)
diff --git a/packages/netcfg/base-installer b/packages/netcfg/base-installer
index da51feb..9ae7a56 100644
--- a/packages/netcfg/base-installer
+++ b/packages/netcfg/base-installer
@@ -1,7 +1,7 @@
 #!/bin/sh -e
 # Copy all relevant networking-related files to /target.
 
-for file in /etc/network/interfaces /etc/networks /etc/hostname /etc/resolv.conf /etc/hosts; do
+for file in /etc/network/interfaces /etc/networks /etc/hostname /etc/resolv.conf /etc/hosts /etc/wpa_supplicant/wpa_supplicant.conf; do
 	if [ -f "$file" ]; then
 		mkdir /target/$(dirname $file) -p
 		cp $file /target/$file
diff --git a/packages/netcfg/debian/netcfg-common.templates b/packages/netcfg/debian/netcfg-common.templates
index 973411e..8ac6f09 100644
--- a/packages/netcfg/debian/netcfg-common.templates
+++ b/packages/netcfg/debian/netcfg-common.templates
@@ -56,6 +56,14 @@ _Description: Wireless ESSID for ${iface}:
  of the wireless network you would like ${iface} to use. To skip wireless
  configuration and continue, leave this field blank.
 
+Template: netcfg/wireless_security_type
+Type: select
+__Choices: WEP/Open, WPA PSK
+# :sl2:
+_Description: Wireless Network Type for ${iface}:
+ Choose WEP/Open if the network is open or secured with WEP.
+ Choose WPA if the network is a WPA PSK protected network.
+
 Template: netcfg/wireless_wep
 Type: string
 # :sl1:
@@ -80,6 +88,19 @@ _Description: Invalid WEP key
  the next screen carefully on how to enter your WEP key correctly, and try
  again.
 
+Template: netcfg/invalid_pass
+Type: error
+# :sl2:
+_Description: Invalid passphrase
+ The WPA PSK passphrase was either too long (more than 64 characters)
+ or too short (less than 8 characters).
+
+Template: netcfg/wireless_wpa
+Type: string
+# :sl1:
+_Description: WPA passphrase for wireless device ${iface}:
+ Enter a passphrase for WPA PSK authentication.
+
 Template: netcfg/invalid_essid
 Type: error
 # :sl2:
diff --git a/packages/netcfg/debian/rules b/packages/netcfg/debian/rules
index 21b5f13..1b2b5ce 100755
--- a/packages/netcfg/debian/rules
+++ b/packages/netcfg/debian/rules
@@ -26,7 +26,7 @@ install: build
 	dh_testdir
 	dh_testroot
 	dh_clean -k
-	dh_installdirs -A usr/lib/base-installer.d etc/network bin
+	dh_installdirs -A usr/lib/base-installer.d etc/network etc/wpa_supplicant bin
 	# Install files that are the same in all packages
 	$(foreach PACKAGE, $(PACKAGES), \
 		install -m 755 $(PACKAGE) debian/$(PACKAGE)/bin/netcfg; \
@@ -36,7 +36,8 @@ install: build
 	$(foreach PACKAGE, $(DHCP_PACKAGES), \
 		mkdir -p debian/$(PACKAGE)/etc/dhcp debian/$(PACKAGE)/etc/dhcp3; \
 		mkdir -p debian/$(PACKAGE)/var/dhcp ; \
-		install -m 755 killall.sh debian/$(PACKAGE)/bin/killall.sh)
+		install -m 755 killall.sh debian/$(PACKAGE)/bin/killall.sh; \
+                install -m 755 killwpa.sh debian/$(PACKAGE)/bin/killwpa.sh)
 
 
 # Build architecture-independent files here.
diff --git a/packages/netcfg/dhcp.c b/packages/netcfg/dhcp.c
index d8dc17d..5a705ad 100644
--- a/packages/netcfg/dhcp.c
+++ b/packages/netcfg/dhcp.c
@@ -50,13 +50,17 @@ static void netcfg_write_dhcp (char *iface, char *dhostname)
             fprintf(fp, "\thostname %s\n", dhostname);
         }
         if (is_wireless_iface(iface)) {
-            fprintf(fp, "\t# wireless-* options are implemented by the wireless-tools package\n");
+            if (requested_wpa_supplicant)
+                fprintf(fp, "\twpa-conf /etc/wpa_supplicant/wpa_supplicant.conf\n");
+            else {
+                fprintf(fp, "\t# wireless-* options are implemented by the wireless-tools package\n");
             fprintf(fp, "\twireless-mode %s\n",
                     (mode == MANAGED) ? "managed" : "ad-hoc");
             fprintf(fp, "\twireless-essid %s\n",
                     (essid && *essid) ? essid : "any");
             if (wepkey != NULL)
                 fprintf(fp, "\twireless-key1 %s\n", wepkey);
+	    }
         }
         fclose(fp);
     }
@@ -196,6 +200,11 @@ static int kill_dhcp_client(void)
     return 0;
 }
 
+static int kill_wpa_supplicant(void)
+{
+    system("killwpa.sh");
+    return 0;
+}
 
 /*
  * Poll the started DHCP client for netcfg/dhcp_timeout seconds (def. 15)
@@ -263,8 +272,6 @@ int poll_dhcp_client (struct debconfclient *client)
 #define REPLY_DONT_CONFIGURE         3
 #define REPLY_RECONFIGURE_WIFI       4
 #define REPLY_LOOP_BACK              5
-#define REPLY_CHECK_DHCP             6
-#define REPLY_ASK_OPTIONS            7
 
 int ask_dhcp_options (struct debconfclient *client)
 {
@@ -304,30 +311,50 @@ int ask_dhcp_options (struct debconfclient *client)
         return REPLY_DONT_CONFIGURE;
 }
 
-int reconfigure_wifi (struct debconfclient *client)
+int reconfigure_wifi(struct debconfclient *client)
 {
-    enum { ABORT, DONE, ESSID, WEP } wifistate = ESSID;
-    for (;;) {
-        switch (wifistate) {
-        case ESSID:
-            wifistate = ( netcfg_wireless_set_essid(client, interface, "high") == GO_BACK ) ?
-                ABORT : WEP;
-            break;
-        case WEP:
-            wifistate = ( netcfg_wireless_set_wep (client, interface) == GO_BACK ) ?
-                ESSID : DONE;
-            break;
-        case ABORT:
-            return REPLY_ASK_OPTIONS;
-            break;
-        case DONE:
-            return REPLY_CHECK_DHCP;
-            break;
-	}
+
+    enum { ABORT, ESSID, SECURITY, WEP, WPA, DONE } wifistate = ESSID;
+
+                    kill_wpa_supplicant();
+                    kill_dhcp_client();
+
+                    for (;;) {
+                        switch (wifistate) {
+                        case ESSID:
+                            wifistate = ( netcfg_wireless_set_essid (client, interface, "high") == GO_BACK ) ?
+                                ABORT : SECURITY;
+                            break;
+                        case SECURITY:
+                            {
+                             int ret;
+                             ret = netcfg_wireless_set_security (client, interface);
+                             if (ret == GO_BACK)
+                                 wifistate = ESSID;
+                             else if (ret == REPLY_WPA)
+                                 wifistate = WPA;
+                             else
+                                 wifistate = WEP;
+                             break;
+                            }
+                        case WEP:
+                            wifistate = (netcfg_wireless_set_wep (client, interface) == GO_BACK) ?
+                                SECURITY : DONE;
+                                break;
+                        case WPA:
+                            wifistate = (netcfg_set_passphrase (client, interface) == GO_BACK) ?
+                                SECURITY : DONE;
+                                break;
+                        case DONE:
+                            return 0;
+                            break;
+                        case ABORT:
+                            return 1;
+                            break;
+        }
     }
 }
 
-
 int netcfg_activate_dhcp (struct debconfclient *client)
 {
     char* dhostname = NULL;
@@ -496,15 +523,10 @@ int netcfg_activate_dhcp (struct debconfclient *client)
                 }
                 break;
             case REPLY_RECONFIGURE_WIFI:
-        	if (reconfigure_wifi(client) == REPLY_CHECK_DHCP)
-            	    if (dhcp_pid > 0)
-            		state = POLL;
-            	    else {
-            		kill_dhcp_client();
-            		state = START;
-            	    }
-            	else
-            	    state = ASK_OPTIONS;
+                if (!reconfigure_wifi(client))
+                    state = START;
+                else
+                    state = ASK_OPTIONS;
                 break;
     	    }
             break;
diff --git a/packages/netcfg/killwpa.sh b/packages/netcfg/killwpa.sh
new file mode 100755
index 0000000..b370bb0
--- /dev/null
+++ b/packages/netcfg/killwpa.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+# Killall for wpasupplicant
+
+# Use [] in sed /address/ to avoid matching sed command itself in ps output
+pids=$(ps ax | sed -n '/[w]pa/s/^[ ]*\([0-9]*\).*/\1/p')
+
+for pid in $pids; do
+  if kill -0 $pid 2>/dev/null; then
+    kill -TERM $pid
+    sleep 1
+    # Still alive? Die!
+    if kill -0 $pid 2>/dev/null; then
+      kill -KILL $pid
+    fi
+  fi
+done
diff --git a/packages/netcfg/netcfg-static.c b/packages/netcfg/netcfg-static.c
index d9962d5..71263e1 100644
--- a/packages/netcfg/netcfg-static.c
+++ b/packages/netcfg/netcfg-static.c
@@ -32,16 +32,19 @@ int main(int argc, char** argv)
     int num_interfaces = 0;
     static struct debconfclient *client;
     static int requested_wireless_tools = 0;
+    int requested_wpa_supplicant = 0;
     
     enum { BACKUP,
-	   GET_INTERFACE,
-	   GET_HOSTNAME_ONLY,
-	   GET_STATIC,
-	   WCONFIG,
-	   WCONFIG_ESSID,
-	   WCONFIG_WEP,
-	   QUIT }
-    
+           GET_INTERFACE,
+           GET_HOSTNAME_ONLY,
+           GET_STATIC,
+           WCONFIG,
+           WCONFIG_ESSID,
+           WCONFIG_SECURITY,
+           WCONFIG_WEP,
+           WCONFIG_WPA,
+           QUIT }
+
     state = GET_INTERFACE;
     
     /* initialize libd-i */
@@ -100,7 +103,17 @@ int main(int argc, char** argv)
             if (netcfg_wireless_set_essid (client, interface, NULL))
                 state = BACKUP;
             else
-                state = WCONFIG_WEP;
+                state = WCONFIG_SECURITY;
+            break;
+
+        case WCONFIG_SECURITY:
+            if (netcfg_wireless_set_security (client, interface) == GO_BACK)
+                state = WCONFIG_ESSID;
+            else
+                if (netcfg_wireless_set_security (client, interface) == REPLY_WPA)
+                    state = WCONFIG_WPA;
+                else
+                    state = WCONFIG_WEP;
             break;
             
         case WCONFIG_WEP:
@@ -109,7 +122,19 @@ int main(int argc, char** argv)
             else
                 state = GET_STATIC;
             break;
-            
+
+        case WCONFIG_WPA:
+            if (requested_wpa_supplicant == 0) {
+                di_exec_shell_log("apt-install wpasupplicant");
+                requested_wpa_supplicant = 1;
+            }
+
+            if (netcfg_set_passphrase(client, interface) == GO_BACK)
+                state = WCONFIG_ESSID;
+            else
+                state = GET_STATIC;
+            break;
+
         case QUIT:
             return 0;
         }
diff --git a/packages/netcfg/netcfg.c b/packages/netcfg/netcfg.c
index 38fc158..e1c7546 100644
--- a/packages/netcfg/netcfg.c
+++ b/packages/netcfg/netcfg.c
@@ -33,6 +33,7 @@
 #endif
 #include "netcfg.h"
 
+int requested_wpa_supplicant = 0;
 static method_t netcfg_method = DHCP;
 
 response_t netcfg_get_method(struct debconfclient *client)
@@ -61,19 +62,22 @@ response_t netcfg_get_method(struct debconfclient *client)
 int main(int argc, char *argv[])
 {
     int num_interfaces = 0;
-    enum { BACKUP, 
-	   GET_INTERFACE,
-	   GET_HOSTNAME_ONLY,
-	   GET_METHOD,
-	   GET_DHCP,
-	   GET_STATIC,
-	   WCONFIG,
-	   WCONFIG_ESSID,
-	   WCONFIG_WEP,
-	   QUIT }
-    
+
+    enum { BACKUP,
+           GET_INTERFACE,
+           GET_HOSTNAME_ONLY,
+           GET_METHOD,
+           GET_DHCP,
+           GET_STATIC,
+           WCONFIG,
+           WCONFIG_ESSID,
+           WCONFIG_SECURITY,
+           WCONFIG_WEP,
+           WCONFIG_WPA,
+           QUIT }
+
      state = GET_INTERFACE;
-    
+
     static struct debconfclient *client;
     static int requested_wireless_tools = 0;
     char **ifaces;
@@ -249,23 +253,49 @@ int main(int argc, char *argv[])
             }
             state = WCONFIG_ESSID;
             break;
-            
+
         case WCONFIG_ESSID:
-            if (netcfg_wireless_set_essid (client, interface, NULL) == GO_BACK)
+            if (netcfg_wireless_set_essid(client, interface, "high") == GO_BACK)
                 state = BACKUP;
             else
-                state = WCONFIG_WEP;
+                state = WCONFIG_SECURITY;
             break;
             
+        case WCONFIG_SECURITY:
+            {
+                int ret;
+                ret = netcfg_wireless_set_security(client, interface);
+                if (ret == GO_BACK)
+                    state = WCONFIG_ESSID;
+                else if (ret == REPLY_WPA)
+                    state = WCONFIG_WPA;
+                else
+                    state = WCONFIG_WEP;
+                break;
+            }
+
         case WCONFIG_WEP:
-            if (netcfg_wireless_set_wep (client, interface) == GO_BACK)
-                state = WCONFIG_ESSID;
+            if (netcfg_wireless_set_wep(client, interface) == GO_BACK)
+                state = WCONFIG_SECURITY;
             else
                 state = GET_METHOD;
             break;
-            
+
+        case WCONFIG_WPA:
+            if (requested_wpa_supplicant == 0) {
+                di_exec_shell_log("apt-install wpasupplicant");
+                requested_wpa_supplicant = 1;
+            }
+
+            if (netcfg_set_passphrase(client, interface) == GO_BACK)
+                state = WCONFIG_SECURITY;
+            else
+                state = GET_METHOD;
+            break;
+
         case QUIT:
             return 0;
         }
     }
 }
+
diff --git a/packages/netcfg/netcfg.h b/packages/netcfg/netcfg.h
index a7bc8a9..da4f82a 100644
--- a/packages/netcfg/netcfg.h
+++ b/packages/netcfg/netcfg.h
@@ -10,11 +10,15 @@
 #define DHCLIENT3_CONF	"/etc/dhcp3/dhclient.conf"
 #define DOMAIN_FILE     "/tmp/domain_name"
 #define NTP_SERVER_FILE "/tmp/dhcp-ntp-servers"
+#define WPASUPP_FILE    "/etc/wpa_supplicant/wpa_supplicant.conf"
 
 #define DEVNAMES	"/etc/network/devnames"
 #define DEVHOTPLUG	"/etc/network/devhotplug"
 #define STAB		"/var/run/stab"
 
+#define WPA_MIN         8
+#define WPA_MAX         64
+
 #define _GNU_SOURCE
 
 #include <sys/types.h>
@@ -41,7 +45,7 @@
 "ff02::2 ip6-allrouters\n" \
 "ff02::3 ip6-allhosts\n"
 
-typedef enum { NOT_ASKED = 30, GO_BACK } response_t;
+typedef enum { NOT_ASKED = 30, GO_BACK, REPLY_WEP, REPLY_WPA } response_t;
 typedef enum { DHCP, STATIC, DUNNO } method_t;
 typedef enum { ADHOC = 1, MANAGED = 2 } wifimode_t;
 
@@ -49,6 +53,7 @@ extern int netcfg_progress_displayed;
 extern int wfd, skfd;
 extern int input_result;
 extern int have_domain;
+extern int requested_wpa_supplicant;
 
 /* network config */
 extern char *interface;
@@ -64,7 +69,7 @@ extern struct in_addr gateway;
 extern struct in_addr pointopoint;
 
 /* wireless */
-extern char *essid, *wepkey;
+extern char *essid, *wepkey, *passphrase;
 extern wifimode_t mode;
 
 /* common functions */
@@ -111,7 +116,11 @@ extern int is_wireless_iface (const char* iface);
 
 extern int netcfg_wireless_set_essid (struct debconfclient *client, char* iface, char* priority);
 extern int netcfg_wireless_set_wep (struct debconfclient *client, char* iface);
+extern int netcfg_wireless_set_security (struct debconfclient *client, char* iface);
+extern int netcfg_set_passphrase (struct debconfclient *client, char* iface);
 
+extern int netcfg_write_wpa (char *essid, char *passphrase);
+extern int start_wpa_supplicant (struct debconfclient *client);
 extern int iface_is_hotpluggable(const char *iface);
 extern short find_in_stab (const char *iface);
 extern void deconfigure_network(void);
diff --git a/packages/netcfg/wireless.c b/packages/netcfg/wireless.c
index ed07b8a..d1a4bac 100644
--- a/packages/netcfg/wireless.c
+++ b/packages/netcfg/wireless.c
@@ -19,6 +19,7 @@ wifimode_t mode = MANAGED;
 /* wireless config */
 char* wepkey = NULL;
 char* essid = NULL;
+char* passphrase = NULL;
 
 #ifdef WIRELESS
 
@@ -189,6 +190,25 @@ static void unset_wep_key (char* iface)
     ret = iw_set_basic_config (wfd, iface, &wconf);
 }
 
+int netcfg_wireless_set_security (struct debconfclient *client, char *iface)
+{
+  int ret = 0 ;
+  debconf_subst (client, "netcfg/wireless_security_type", "iface", iface);
+  debconf_input (client, "high", "netcfg/wireless_security_type");
+  ret = debconf_go(client);
+
+  if (ret == 30)
+    return GO_BACK;
+
+  debconf_get (client, "netcfg/wireless_security_type");
+
+  if (!strcmp(client->value, "WEP/Open Network"))
+     return REPLY_WEP;
+  else
+     return REPLY_WPA;
+
+}
+
 int netcfg_wireless_set_wep (struct debconfclient * client, char* iface)
 {
     wireless_config wconf;
@@ -250,6 +270,50 @@ int netcfg_wireless_set_wep (struct debconfclient * client, char* iface)
     return 0;
 }
 
+int netcfg_set_passphrase (struct debconfclient *client, char *iface)
+{
+  wireless_config wconf;
+  int ret;
+
+  iw_get_basic_config (wfd, iface, &wconf);
+
+  unset_wep_key (iface);
+
+  debconf_subst (client, "netcfg/wireless_wpa", "iface", iface);
+  debconf_input (client, "high", "netcfg/wireless_wpa");
+  ret = debconf_go (client);
+
+  if (ret == 30)
+    return GO_BACK;
+
+  debconf_get (client, "netcfg/wireless_wpa");
+  passphrase = client->value;
+
+  while (strlen (passphrase) < WPA_MIN || strlen (passphrase) > WPA_MAX) {
+      debconf_subst (client, "netcfg/invalid_pass", "passphrase", passphrase);
+      debconf_input (client, "critical", "netcfg/invalid_pass");
+      debconf_go (client);
+
+      debconf_input (client, "high", "netcfg/wireless_wpa");
+      ret = debconf_go (client);
+
+
+      if (ret == 30)
+        return GO_BACK;
+
+      debconf_get (client, "netcfg/wireless_wpa");
+      passphrase = client->value;
+    }
+
+  if (netcfg_write_wpa (essid, passphrase))
+    return -1;
+
+  if (start_wpa_supplicant (client))
+    return -1;
+
+  return 0;
+}
+
 #else
 
 int is_wireless_iface (const char *iface)
diff --git a/packages/netcfg/wpa.c b/packages/netcfg/wpa.c
new file mode 100644
index 0000000..ab936f6
--- /dev/null
+++ b/packages/netcfg/wpa.c
@@ -0,0 +1,81 @@
+/*
+* WPA module for netcfg
+*
+* Copyright (C) 2008 Glenn Saberton <gsaberton@foomagic.org>
+*
+* Licensed under the terms of the GNU General Public License version 2
+*
+* Functions shamelessly copied from dhcp.c, if you are looking for comments
+* look in that file.
+*/
+
+#include "netcfg.h"
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <debian-installer.h>
+
+
+static int wpa_supplicant_exit_status = 1;
+pid_t wpa_supplicant_pid = -1;
+
+/*
+* Build an /etc/wpa_supplicant.conf
+* file.
+*/
+
+int netcfg_write_wpa (char *essid, char *passphrase)
+{
+  FILE *fp;
+
+  if ((fp = file_open (WPASUPP_FILE, "w"))) {
+      fprintf (fp, "\n# wpa_supplicant.conf generated during install\n"
+    		   "ctrl_interface=/var/run/wpa_supplicant\n"
+    		   "ctrl_interface_group=0\n"
+    		   "eapol_version=1\n"
+    		   "ap_scan=1\n\n"	/* So we can associate to hidden ssid's  */
+	    	   "network={\n");
+      fprintf (fp, "\t\tssid=\"%s\"\n", essid);
+      fprintf (fp, "\t\tpsk=\"%s\"\n", passphrase);
+      fprintf (fp, "\t\tscan_ssid=1\n" "}\n");
+    }
+  fclose (fp);
+  return 0;
+}
+
+static void wpa_supplicant_sigchild (int sig __attribute__ ((unused)))
+{
+  if (wpa_supplicant_pid <= 0)
+    return;
+
+  waitpid (wpa_supplicant_pid, &wpa_supplicant_exit_status, 0);
+  wpa_supplicant_pid = -1;
+}
+
+int start_wpa_supplicant (struct debconfclient *client)
+{
+
+  if (access ("/sbin/wpa_supplicant", F_OK) == 0);
+
+  else {
+      debconf_input (client, "critical", "netcfg/no_wpa_supplicant");
+      debconf_go (client);
+      exit (1);
+    }
+
+wpa_supplicant_pid = fork();
+
+  if (wpa_supplicant_pid == 0) {
+        fclose(client->out);
+        if (execlp ("wpa_supplicant", "wpa_supplicant", "-i", interface, "-c", "/etc/wpa_supplicant/wpa_supplicant.conf", "-B", NULL) == -1) {
+            di_error("could not exec wpasupplicant: %s", strerror(errno));
+            return 1;
+          }
+        else
+    	    return 0;
+    } 
+  else {
+     signal(SIGCHLD, &wpa_supplicant_sigchild);
+     return 0;
+    }
+}
-- 
1.5.5.1


Reply to: