[pkg-wpa-devel] r1041 - in /wpasupplicant/trunk/debian: changelog patches/37_rm_wait_for_interface.patch patches/series

kelmo-guest at users.alioth.debian.org kelmo-guest at users.alioth.debian.org
Sun Jan 13 22:29:30 UTC 2008


Author: kelmo-guest
Date: Sun Jan 13 22:29:30 2008
New Revision: 1041

URL: http://svn.debian.org/wsvn/pkg-wpa/?sc=1&rev=1041
Log:
* Add debian/patches/37_rm_wait_for_interface.patch to remove the horribly
  broken wait_for_interface complexity provided along with the -w command
  line option. (Closes: #350963)

Added:
    wpasupplicant/trunk/debian/patches/37_rm_wait_for_interface.patch
Modified:
    wpasupplicant/trunk/debian/changelog
    wpasupplicant/trunk/debian/patches/series

Modified: wpasupplicant/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/changelog?rev=1041&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/changelog (original)
+++ wpasupplicant/trunk/debian/changelog Sun Jan 13 22:29:30 2008
@@ -1,6 +1,5 @@
 wpasupplicant (0.6.2-2) UNRELEASED; urgency=low
 
-  * DO NOT RELEASE.
   * Make sure wpa_supplicant process is checked for and killed by wpa_action
     on stop or down actions.
   * Add debian/patches/35_ctrl_iface_disable_all.patch to activate
@@ -13,8 +12,11 @@
     advantage of `disable_network all` and `enable_network all` via wpa_gui.
   * Add debian/patches/33_wpa_gui_qt4_save_config.patch to allow configuration
     to be saved from file menu item.
-
- -- Kel Modderman <kel at otaku42.de>  Mon, 14 Jan 2008 07:43:57 +1000
+  * Add debian/patches/37_rm_wait_for_interface.patch to remove the horribly
+    broken wait_for_interface complexity provided along with the -w command
+    line option. (Closes: #350963)
+
+ -- Kel Modderman <kel at otaku42.de>  Mon, 14 Jan 2008 08:27:20 +1000
 
 wpasupplicant (0.6.2-1) experimental; urgency=low
 

Added: wpasupplicant/trunk/debian/patches/37_rm_wait_for_interface.patch
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/patches/37_rm_wait_for_interface.patch?rev=1041&op=file
==============================================================================
--- wpasupplicant/trunk/debian/patches/37_rm_wait_for_interface.patch (added)
+++ wpasupplicant/trunk/debian/patches/37_rm_wait_for_interface.patch Sun Jan 13 22:29:30 2008
@@ -1,0 +1,223 @@
+--- a/wpa_supplicant/main.c
++++ b/wpa_supplicant/main.c
+@@ -147,7 +147,7 @@
+ 	wpa_supplicant_fd_workaround();
+ 
+ 	for (;;) {
+-		c = getopt(argc, argv, "b:Bc:C:D:df:g:hi:KLNp:P:qtuvwW");
++		c = getopt(argc, argv, "b:Bc:C:D:df:g:hi:KLNp:P:qtuvW");
+ 		if (c < 0)
+ 			break;
+ 		switch (c) {
+@@ -220,9 +220,6 @@
+ 			printf("%s\n", wpa_supplicant_version);
+ 			exitcode = 0;
+ 			goto out;
+-		case 'w':
+-			params.wait_for_interface++;
+-			break;
+ 		case 'W':
+ 			params.wait_for_monitor++;
+ 			break;
+--- a/wpa_supplicant/wpa_supplicant.c
++++ b/wpa_supplicant/wpa_supplicant.c
+@@ -1471,36 +1471,26 @@
+ /**
+  * wpa_supplicant_driver_init - Initialize driver interface parameters
+  * @wpa_s: Pointer to wpa_supplicant data
+- * @wait_for_interface: 0 = do not wait for the interface (reports a failure if
+- * the interface is not present), 1 = wait until the interface is available
+- * Returns: 0 on success, -1 on failure
+  *
+  * This function is called to initialize driver interface parameters.
+  * wpa_drv_init() must have been called before this function to initialize the
+  * driver interface.
+  */
+-int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s,
+-			       int wait_for_interface)
++int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s)
+ {
+ 	static int interface_count = 0;
+ 
+-	for (;;) {
+-		if (wpa_s->driver->send_eapol) {
+-			const u8 *addr = wpa_drv_get_mac_addr(wpa_s);
+-			if (addr)
+-				os_memcpy(wpa_s->own_addr, addr, ETH_ALEN);
+-			break;
+-		}
++	if (wpa_s->driver->send_eapol) {
++		const u8 *addr = wpa_drv_get_mac_addr(wpa_s);
++		if (addr)
++			os_memcpy(wpa_s->own_addr, addr, ETH_ALEN);
++	} else {
+ 		wpa_s->l2 = l2_packet_init(wpa_s->ifname,
+ 					   wpa_drv_get_mac_addr(wpa_s),
+ 					   ETH_P_EAPOL,
+ 					   wpa_supplicant_rx_eapol, wpa_s, 0);
+-		if (wpa_s->l2)
+-			break;
+-		else if (!wait_for_interface)
++		if (wpa_s->l2 == NULL)
+ 			return -1;
+-		wpa_printf(MSG_DEBUG, "Waiting for interface..");
+-		os_sleep(5, 0);
+ 	}
+ 
+ 	if (wpa_s->l2 && l2_packet_get_own_addr(wpa_s->l2, wpa_s->own_addr)) {
+@@ -1668,8 +1658,7 @@
+ }
+ 
+ 
+-static int wpa_supplicant_init_iface2(struct wpa_supplicant *wpa_s,
+-				      int wait_for_interface)
++static int wpa_supplicant_init_iface2(struct wpa_supplicant *wpa_s)
+ {
+ 	const char *ifname;
+ 	struct wpa_driver_capa capa;
+@@ -1739,9 +1728,9 @@
+ 		return -1;
+ 	}
+ 
+-	if (wpa_supplicant_driver_init(wpa_s, wait_for_interface) < 0) {
++	if (wpa_supplicant_driver_init(wpa_s) < 0)
+ 		return -1;
+-	}
++
+ 	wpa_sm_set_own_addr(wpa_s->wpa, wpa_s->own_addr);
+ 
+ 	wpa_s->ctrl_iface = wpa_supplicant_ctrl_iface_init(wpa_s);
+@@ -1825,8 +1814,7 @@
+ 		return NULL;
+ 
+ 	if (wpa_supplicant_init_iface(wpa_s, iface) ||
+-	    wpa_supplicant_init_iface2(wpa_s,
+-				       global->params.wait_for_interface)) {
++	    wpa_supplicant_init_iface2(wpa_s)) {
+ 		wpa_printf(MSG_DEBUG, "Failed to add interface %s",
+ 			   iface->ifname);
+ 		wpa_supplicant_deinit_iface(wpa_s);
+@@ -1940,7 +1928,6 @@
+ 	if (global == NULL)
+ 		return NULL;
+ 	global->params.daemonize = params->daemonize;
+-	global->params.wait_for_interface = params->wait_for_interface;
+ 	global->params.wait_for_monitor = params->wait_for_monitor;
+ 	global->params.dbus_ctrl_interface = params->dbus_ctrl_interface;
+ 	if (params->pid_file)
+@@ -1976,8 +1963,8 @@
+ 		}
+ 	}
+ 
+-	if (global->params.wait_for_interface && global->params.daemonize &&
+-	    wpa_supplicant_daemon(global->params.pid_file)) {
++	if (global->params.daemonize &&
++	    wpa_supplicant_daemon(global->params.pid_file) < 0) {
+ 		wpa_supplicant_deinit(global);
+ 		return NULL;
+ 	}
+@@ -1999,8 +1986,8 @@
+ {
+ 	struct wpa_supplicant *wpa_s;
+ 
+-	if (!global->params.wait_for_interface && global->params.daemonize &&
+-	    wpa_supplicant_daemon(global->params.pid_file))
++	if (global->params.daemonize &&
++	    wpa_supplicant_daemon(global->params.pid_file) < 0)
+ 		return -1;
+ 
+ 	if (global->params.wait_for_monitor) {
+--- a/wpa_supplicant/wpa_supplicant_i.h
++++ b/wpa_supplicant/wpa_supplicant_i.h
+@@ -96,17 +96,6 @@
+ 	int daemonize;
+ 
+ 	/**
+-	 * wait_for_interface - Wait for the network interface to appear
+-	 *
+-	 * If set, %wpa_supplicant will wait until all the configured network
+-	 * interfaces are available before starting processing. Please note
+-	 * that in many cases, a better alternative would be to start
+-	 * %wpa_supplicant without network interfaces and add the interfaces
+-	 * dynamically whenever they become available.
+-	 */
+-	int wait_for_interface;
+-
+-	/**
+ 	 * wait_for_monitor - Wait for a monitor program before starting
+ 	 */
+ 	int wait_for_monitor;
+@@ -349,8 +338,7 @@
+ int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s);
+ 
+ const char * wpa_supplicant_state_txt(int state);
+-int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s,
+-			       int wait_for_interface);
++int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s);
+ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
+ 			      struct wpa_scan_res *bss,
+ 			      struct wpa_ssid *ssid,
+--- a/wpa_supplicant/doc/docbook/wpa_supplicant.sgml
++++ b/wpa_supplicant/doc/docbook/wpa_supplicant.sgml
+@@ -12,7 +12,7 @@
+   <refsynopsisdiv>
+     <cmdsynopsis>
+       <command>wpa_supplicant</command>
+-      <arg>-BddfhKLqqtuvwW</arg>
++      <arg>-BddfhKLqqtuvW</arg>
+       <arg>-i<replaceable>ifname</replaceable></arg>
+       <arg>-c<replaceable>config file</replaceable></arg>
+       <arg>-D<replaceable>driver</replaceable></arg>
+@@ -67,10 +67,7 @@
+     <para>Before wpa_supplicant can do its work, the network interface
+     must be available.  That means that the physical device must be
+     present and enabled, and the driver for the device must have be
+-    loaded.  Note, however, that the '-w' option of the wpa_supplicant
+-    daemon instructs the daemon to continue running and to wait for
+-    the interface to become available.  Without the '-w' option, the
+-    daemon will exit immediately if the device is not already
++    loaded. The daemon will exit immediately if the device is not already
+     available.</para>
+ 
+     <para>After <command>wpa_supplicant</command> has configured the
+@@ -454,15 +451,6 @@
+       </varlistentry>
+ 
+       <varlistentry>
+-	<term>-w</term>
+-	<listitem>
+-	  <para>Wait for interface to be added, if needed.  Normally,
+-	  <command>wpa_supplicant</command> will exit if the interface
+-	  is not there yet.</para>
+-	</listitem>
+-      </varlistentry>
+-
+-      <varlistentry>
+ 	<term>-W</term>
+ 	<listitem>
+ 	  <para>Wait for a control interface monitor before starting.</para>
+@@ -485,11 +473,10 @@
+     started with:</para>
+ 
+ <blockquote><programlisting>
+-wpa_supplicant -Bw -c/etc/wpa_supplicant.conf -iwlan0
++wpa_supplicant -B -c/etc/wpa_supplicant.conf -iwlan0
+ </programlisting></blockquote>
+ 
+-    <para>This makes the process fork into background and wait for the wlan0
+-    interface if it is not available at startup time.</para>
++    <para>This makes the process fork into background.</para>
+ 
+     <para>The easiest way to debug problems, and to get debug log for
+     bug reports, is to start <command>wpa_supplicant</command> on
+--- a/wpa_supplicant/events.c
++++ b/wpa_supplicant/events.c
+@@ -862,7 +862,7 @@
+ 			break;
+ 		wpa_s->interface_removed = 0;
+ 		wpa_printf(MSG_DEBUG, "Configured interface was added.");
+-		if (wpa_supplicant_driver_init(wpa_s, 1) < 0) {
++		if (wpa_supplicant_driver_init(wpa_s) < 0) {
+ 			wpa_printf(MSG_INFO, "Failed to initialize the driver "
+ 				   "after interface was added.");
+ 		}

Modified: wpasupplicant/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/patches/series?rev=1041&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/patches/series (original)
+++ wpasupplicant/trunk/debian/patches/series Sun Jan 13 22:29:30 2008
@@ -12,3 +12,4 @@
 34_ctrl_iface_enable_all.patch
 35_ctrl_iface_disable_all.patch
 36_ctrl_iface_remove_all.patch
+37_rm_wait_for_interface.patch




More information about the Pkg-wpa-devel mailing list