[pkg-wpa-devel] r1345 - in /wpasupplicant/trunk/debian: changelog config/linux patches/04_append_mmd_to_default_cflags.patch patches/10_multi_driver.patch patches/11_syslog.patch patches/series rules

kelmo-guest at users.alioth.debian.org kelmo-guest at users.alioth.debian.org
Mon Mar 23 23:59:34 UTC 2009


Author: kelmo-guest
Date: Mon Mar 23 23:59:34 2009
New Revision: 1345

URL: http://svn.debian.org/wsvn/pkg-wpa/?sc=1&rev=1345
Log:
* Instead of patching upstream to append -MMD compiler flag set that
  as default in debian/rules. Purge
  debian/patches/04_append_mmd_to_default_cflags.patch.
* Backport syslog support patch from 0.7.X development branch. Patch
  name is debian/patches/11_syslog.patch.
* Backport patch from 0.7.X to allow multiple driver wrappers to be
  tried until one works. This will allow some kind of transition
  smoothing as drivers transition from wext -> nl80211 in the future.

Added:
    wpasupplicant/trunk/debian/patches/10_multi_driver.patch
    wpasupplicant/trunk/debian/patches/11_syslog.patch
Removed:
    wpasupplicant/trunk/debian/patches/04_append_mmd_to_default_cflags.patch
Modified:
    wpasupplicant/trunk/debian/changelog
    wpasupplicant/trunk/debian/config/linux
    wpasupplicant/trunk/debian/patches/series
    wpasupplicant/trunk/debian/rules

Modified: wpasupplicant/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/changelog?rev=1345&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/changelog (original)
+++ wpasupplicant/trunk/debian/changelog Mon Mar 23 23:59:34 2009
@@ -20,8 +20,16 @@
   * Add copyright information about src/wps/httpread.* to
     debian/copyright.
   * Bump Standards-Version to 3.8.1, no other changes required.
-
- -- Kel Modderman <kel at otaku42.de>  Tue, 24 Mar 2009 01:43:29 +1000
+  * Instead of patching upstream to append -MMD compiler flag set that
+    as default in debian/rules. Purge
+    debian/patches/04_append_mmd_to_default_cflags.patch.
+  * Backport syslog support patch from 0.7.X development branch. Patch
+    name is debian/patches/11_syslog.patch.
+  * Backport patch from 0.7.X to allow multiple driver wrappers to be
+    tried until one works. This will allow some kind of transition
+    smoothing as drivers transition from wext -> nl80211 in the future.
+
+ -- Kel Modderman <kel at otaku42.de>  Tue, 24 Mar 2009 09:57:26 +1000
 
 wpasupplicant (0.6.7-1) experimental; urgency=low
 

Modified: wpasupplicant/trunk/debian/config/linux
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/config/linux?rev=1345&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/config/linux (original)
+++ wpasupplicant/trunk/debian/config/linux Mon Mar 23 23:59:34 2009
@@ -341,6 +341,9 @@
 # Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt)
 CONFIG_DEBUG_FILE=y
 
+# Enable syslog support
+CFLAGS += -DCONFIG_DEBUG_SYSLOG
+
 # Enable privilege separation (see README 'Privilege separation' for details)
 #CONFIG_PRIVSEP=y
 

Added: wpasupplicant/trunk/debian/patches/10_multi_driver.patch
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/patches/10_multi_driver.patch?rev=1345&op=file
==============================================================================
--- wpasupplicant/trunk/debian/patches/10_multi_driver.patch (added)
+++ wpasupplicant/trunk/debian/patches/10_multi_driver.patch Mon Mar 23 23:59:34 2009
@@ -1,0 +1,369 @@
+From: Jouni Malinen <j at w1.fi>
+Date: Sat, 14 Feb 2009 14:43:43 +0000 (+0200)
+Subject: Allow multiple driver wrappers to be specified on command line
+X-Git-Url: http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=commitdiff_plain;h=362f781e1cfbc006d6e0d776981e8bc90ae9354f
+
+Allow multiple driver wrappers to be specified on command line
+
+For example, -Dnl80211,wext could be used to automatically select
+between nl80211 and wext. The first driver wrapper that is able to
+initialize the interface will be used.
+---
+
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -89,7 +89,7 @@ static void wpa_driver_nl80211_scan_time
+ static int wpa_driver_nl80211_set_mode(void *priv, int mode);
+ static int wpa_driver_nl80211_flush_pmkid(void *priv);
+ static int wpa_driver_nl80211_get_range(void *priv);
+-static void
++static int
+ wpa_driver_nl80211_finish_drv_init(struct wpa_driver_nl80211_data *drv);
+ 
+ 
+@@ -1492,10 +1492,14 @@ static void * wpa_driver_nl80211_init(vo
+ 				 ctx);
+ 	drv->wext_event_sock = s;
+ 
+-	wpa_driver_nl80211_finish_drv_init(drv);
++	if (wpa_driver_nl80211_finish_drv_init(drv))
++		goto err7;
+ 
+ 	return drv;
+ 
++err7:
++	eloop_unregister_read_sock(drv->wext_event_sock);
++	close(drv->wext_event_sock);
+ err6:
+ 	close(drv->ioctl_sock);
+ err5:
+@@ -1512,17 +1516,21 @@ err1:
+ }
+ 
+ 
+-static void
++static int
+ wpa_driver_nl80211_finish_drv_init(struct wpa_driver_nl80211_data *drv)
+ {
+ 	int flags;
+ 
+-	if (wpa_driver_nl80211_get_ifflags(drv, &flags) != 0)
+-		printf("Could not get interface '%s' flags\n", drv->ifname);
+-	else if (!(flags & IFF_UP)) {
++	if (wpa_driver_nl80211_get_ifflags(drv, &flags) != 0) {
++		wpa_printf(MSG_ERROR, "Could not get interface '%s' flags",
++			   drv->ifname);
++		return -1;
++	}
++	if (!(flags & IFF_UP)) {
+ 		if (wpa_driver_nl80211_set_ifflags(drv, flags | IFF_UP) != 0) {
+-			printf("Could not set interface '%s' UP\n",
+-			       drv->ifname);
++			wpa_printf(MSG_ERROR, "Could not set interface '%s' "
++				   "UP", drv->ifname);
++			return -1;
+ 		}
+ 	}
+ 
+@@ -1540,6 +1548,8 @@ wpa_driver_nl80211_finish_drv_init(struc
+ 	drv->ifindex = if_nametoindex(drv->ifname);
+ 
+ 	wpa_driver_nl80211_send_oper_ifla(drv, 1, IF_OPER_DORMANT);
++
++	return 0;
+ }
+ 
+ 
+--- a/src/drivers/driver_wext.c
++++ b/src/drivers/driver_wext.c
+@@ -34,7 +34,7 @@
+ 
+ static int wpa_driver_wext_flush_pmkid(void *priv);
+ static int wpa_driver_wext_get_range(void *priv);
+-static void wpa_driver_wext_finish_drv_init(struct wpa_driver_wext_data *drv);
++static int wpa_driver_wext_finish_drv_init(struct wpa_driver_wext_data *drv);
+ 
+ 
+ static int wpa_driver_wext_send_oper_ifla(struct wpa_driver_wext_data *drv,
+@@ -913,50 +913,60 @@ void * wpa_driver_wext_init(void *ctx, c
+ 	drv->ioctl_sock = socket(PF_INET, SOCK_DGRAM, 0);
+ 	if (drv->ioctl_sock < 0) {
+ 		perror("socket(PF_INET,SOCK_DGRAM)");
+-		os_free(drv);
+-		return NULL;
++		goto err1;
+ 	}
+ 
+ 	s = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
+ 	if (s < 0) {
+ 		perror("socket(PF_NETLINK,SOCK_RAW,NETLINK_ROUTE)");
+-		close(drv->ioctl_sock);
+-		os_free(drv);
+-		return NULL;
++		goto err2;
+ 	}
++	drv->event_sock = s;
+ 
+ 	os_memset(&local, 0, sizeof(local));
+ 	local.nl_family = AF_NETLINK;
+ 	local.nl_groups = RTMGRP_LINK;
+ 	if (bind(s, (struct sockaddr *) &local, sizeof(local)) < 0) {
+ 		perror("bind(netlink)");
+-		close(s);
+-		close(drv->ioctl_sock);
+-		os_free(drv);
+-		return NULL;
++		goto err3;
+ 	}
+ 
+ 	eloop_register_read_sock(s, wpa_driver_wext_event_receive, drv, ctx);
+-	drv->event_sock = s;
+ 
+ 	drv->mlme_sock = -1;
+ 
+-	wpa_driver_wext_finish_drv_init(drv);
++	if (wpa_driver_wext_finish_drv_init(drv) < 0)
++		goto err4;
+ 
+ 	return drv;
++
++err4:
++	eloop_unregister_read_sock(drv->event_sock);
++err3:
++	close(drv->event_sock);
++err2:
++	close(drv->ioctl_sock);
++err1:
++	os_free(drv);
++	return NULL;
+ }
+ 
+ 
+-static void wpa_driver_wext_finish_drv_init(struct wpa_driver_wext_data *drv)
++static int wpa_driver_wext_finish_drv_init(struct wpa_driver_wext_data *drv)
+ {
+ 	int flags;
+ 
+-	if (wpa_driver_wext_get_ifflags(drv, &flags) != 0)
+-		printf("Could not get interface '%s' flags\n", drv->ifname);
+-	else if (!(flags & IFF_UP)) {
++	if (wpa_driver_wext_get_ifflags(drv, &flags) != 0) {
++		wpa_printf(MSG_ERROR, "Could not get interface '%s' flags",
++			   drv->ifname);
++		return -1;
++	}
++
++	if (!(flags & IFF_UP)) {
+ 		if (wpa_driver_wext_set_ifflags(drv, flags | IFF_UP) != 0) {
+-			printf("Could not set interface '%s' UP\n",
+-			       drv->ifname);
++			wpa_printf(MSG_ERROR, "Could not set interface '%s' "
++				   "UP", drv->ifname);
++			return -1;
+ 		} else {
+ 			/*
+ 			 * Wait some time to allow driver to initialize before
+@@ -977,7 +987,9 @@ static void wpa_driver_wext_finish_drv_i
+ 	wpa_driver_wext_flush_pmkid(drv);
+ 
+ 	if (wpa_driver_wext_set_mode(drv, 0) < 0) {
+-		printf("Could not configure driver to use managed mode\n");
++		wpa_printf(MSG_DEBUG, "Could not configure driver to use "
++			   "managed mode");
++		/* Try to use it anyway */
+ 	}
+ 
+ 	wpa_driver_wext_get_range(drv);
+@@ -1000,6 +1012,8 @@ static void wpa_driver_wext_finish_drv_i
+ 	}
+ 
+ 	wpa_driver_wext_send_oper_ifla(drv, 1, IF_OPER_DORMANT);
++
++	return 0;
+ }
+ 
+ 
+--- a/wpa_supplicant/ChangeLog
++++ b/wpa_supplicant/ChangeLog
+@@ -11,6 +11,9 @@ ChangeLog for wpa_supplicant
+ 	  configurable with a new command line options (-G<seconds>)
+ 	* fixed scan buffer processing with WEXT to handle up to 65535
+ 	  byte result buffer (previously, limited to 32768 bytes)
++	* allow multiple driver wrappers to be specified on command line
++	  (e.g., -Dnl80211,wext); the first one that is able to initialize the
++	  interface will be used
+ 
+ 2009-01-06 - v0.6.7
+ 	* added support for Wi-Fi Protected Setup (WPS)
+--- a/wpa_supplicant/README
++++ b/wpa_supplicant/README
+@@ -500,7 +500,7 @@ options:
+   -C = ctrl_interface parameter (only used if -c is not)
+   -i = interface name
+   -d = increase debugging verbosity (-dd even more)
+-  -D = driver name
++  -D = driver name (can be multiple drivers: nl80211,wext)
+   -f = Log output to default log location (normally /tmp)
+   -g = global ctrl_interface
+   -K = include keys (passwords, etc.) in debug output
+@@ -544,6 +544,13 @@ enabled:
+ 
+ wpa_supplicant -c/etc/wpa_supplicant.conf -iwlan0 -d
+ 
++If the specific driver wrapper is not known beforehand, it is possible
++to specify multiple comma separated driver wrappers on the command
++line. wpa_supplicant will use the first driver wrapper that is able to
++initialize the interface.
++
++wpa_supplicant -Dnl80211,wext -c/etc/wpa_supplicant.conf -iwlan0
++
+ 
+ wpa_supplicant can control multiple interfaces (radios) either by
+ running one process for each interface separately or by running just
+--- a/wpa_supplicant/doc/docbook/wpa_supplicant.sgml
++++ b/wpa_supplicant/doc/docbook/wpa_supplicant.sgml
+@@ -388,8 +388,8 @@
+       <varlistentry>
+ 	<term>-D driver</term>
+ 	<listitem>
+-	  <para>Driver to use. (Per interface, see the available options
+-		  below.)</para>
++	  <para>Driver to use (can be multiple drivers: nl80211,wext).
++		  (Per interface, see the available options below.)</para>
+ 	</listitem>
+       </varlistentry>
+ 
+@@ -509,6 +509,15 @@ wpa_supplicant -B -c/etc/wpa_supplicant.
+ wpa_supplicant -c/etc/wpa_supplicant.conf -iwlan0 -d
+ </programlisting></blockquote>
+ 
++    <para>If the specific driver wrapper is not known beforehand, it is
++    possible to specify multiple comma separated driver wrappers on the command
++    line. <command>wpa_supplicant</command> will use the first driver
++    wrapper that is able to initialize the interface.</para>
++
++<blockquote><programlisting>
++wpa_supplicant -Dnl80211,wext -c/etc/wpa_supplicant.conf -iwlan0
++</programlisting></blockquote>
++
+     <para><command>wpa_supplicant</command> can control multiple
+     interfaces (radios) either by running one process for each
+     interface separately or by running just one process and list of
+--- a/wpa_supplicant/main.c
++++ b/wpa_supplicant/main.c
+@@ -52,7 +52,7 @@ static void usage(void)
+ 	       "  -C = ctrl_interface parameter (only used if -c is not)\n"
+ 	       "  -i = interface name\n"
+ 	       "  -d = increase debugging verbosity (-dd even more)\n"
+-	       "  -D = driver name\n"
++	       "  -D = driver name (can be multiple drivers: nl80211,wext)\n"
+ #ifdef CONFIG_DEBUG_FILE
+ 	       "  -f = log output to debug file instead of stdout\n"
+ #endif /* CONFIG_DEBUG_FILE */
+--- a/wpa_supplicant/wpa_supplicant.c
++++ b/wpa_supplicant/wpa_supplicant.c
+@@ -1458,6 +1458,8 @@ static int wpa_supplicant_set_driver(str
+ 				     const char *name)
+ {
+ 	int i;
++	size_t len;
++	const char *pos;
+ 
+ 	if (wpa_s == NULL)
+ 		return -1;
+@@ -1474,14 +1476,21 @@ static int wpa_supplicant_set_driver(str
+ 		return 0;
+ 	}
+ 
++	pos = os_strchr(name, ',');
++	if (pos)
++		len = pos - name;
++	else
++		len = os_strlen(name);
+ 	for (i = 0; wpa_supplicant_drivers[i]; i++) {
+-		if (os_strcmp(name, wpa_supplicant_drivers[i]->name) == 0) {
++		if (os_strlen(wpa_supplicant_drivers[i]->name) == len &&
++		    os_strncmp(name, wpa_supplicant_drivers[i]->name, len) ==
++		    0) {
+ 			wpa_s->driver = wpa_supplicant_drivers[i];
+ 			return 0;
+ 		}
+ 	}
+ 
+-	wpa_printf(MSG_ERROR, "Unsupported driver '%s'.\n", name);
++	wpa_printf(MSG_ERROR, "Unsupported driver '%s'.", name);
+ 	return -1;
+ }
+ 
+@@ -1669,6 +1678,9 @@ static struct wpa_supplicant * wpa_suppl
+ static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s,
+ 				     struct wpa_interface *iface)
+ {
++	const char *ifname, *driver;
++	struct wpa_driver_capa capa;
++
+ 	wpa_printf(MSG_DEBUG, "Initializing interface '%s' conf '%s' driver "
+ 		   "'%s' ctrl_interface '%s' bridge '%s'", iface->ifname,
+ 		   iface->confname ? iface->confname : "N/A",
+@@ -1676,10 +1688,6 @@ static int wpa_supplicant_init_iface(str
+ 		   iface->ctrl_interface ? iface->ctrl_interface : "N/A",
+ 		   iface->bridge_ifname ? iface->bridge_ifname : "N/A");
+ 
+-	if (wpa_supplicant_set_driver(wpa_s, iface->driver) < 0) {
+-		return -1;
+-	}
+-
+ 	if (iface->confname) {
+ #ifdef CONFIG_BACKEND_FILE
+ 		wpa_s->confname = os_rel2abs_path(iface->confname);
+@@ -1747,18 +1755,6 @@ static int wpa_supplicant_init_iface(str
+ 			   sizeof(wpa_s->bridge_ifname));
+ 	}
+ 
+-	return 0;
+-}
+-
+-
+-static int wpa_supplicant_init_iface2(struct wpa_supplicant *wpa_s)
+-{
+-	const char *ifname;
+-	struct wpa_driver_capa capa;
+-
+-	wpa_printf(MSG_DEBUG, "Initializing interface (2) '%s'",
+-		   wpa_s->ifname);
+-
+ 	/* RSNA Supplicant Key Management - INITIALIZE */
+ 	eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE);
+ 	eapol_sm_notify_portValid(wpa_s->eapol, FALSE);
+@@ -1767,8 +1763,21 @@ static int wpa_supplicant_init_iface2(st
+ 	 * L2 receive handler so that association events are processed before
+ 	 * EAPOL-Key packets if both become available for the same select()
+ 	 * call. */
++	driver = iface->driver;
++next_driver:
++	if (wpa_supplicant_set_driver(wpa_s, driver) < 0)
++		return -1;
++
+ 	wpa_s->drv_priv = wpa_drv_init(wpa_s, wpa_s->ifname);
+ 	if (wpa_s->drv_priv == NULL) {
++		const char *pos;
++		pos = os_strchr(driver, ',');
++		if (pos) {
++			wpa_printf(MSG_DEBUG, "Failed to initialize driver "
++				   "interface - try next driver wrapper");
++			driver = pos + 1;
++			goto next_driver;
++		}
+ 		wpa_printf(MSG_ERROR, "Failed to initialize driver interface");
+ 		return -1;
+ 	}
+@@ -1915,8 +1924,7 @@ struct wpa_supplicant * wpa_supplicant_a
+ 	if (wpa_s == NULL)
+ 		return NULL;
+ 
+-	if (wpa_supplicant_init_iface(wpa_s, iface) ||
+-	    wpa_supplicant_init_iface2(wpa_s)) {
++	if (wpa_supplicant_init_iface(wpa_s, iface)) {
+ 		wpa_printf(MSG_DEBUG, "Failed to add interface %s",
+ 			   iface->ifname);
+ 		wpa_supplicant_deinit_iface(wpa_s);

Added: wpasupplicant/trunk/debian/patches/11_syslog.patch
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/patches/11_syslog.patch?rev=1345&op=file
==============================================================================
--- wpasupplicant/trunk/debian/patches/11_syslog.patch (added)
+++ wpasupplicant/trunk/debian/patches/11_syslog.patch Mon Mar 23 23:59:34 2009
@@ -1,0 +1,222 @@
+From: Sam Leffler <sam at errno.com>
+Date: Mon, 2 Mar 2009 19:40:44 +0000 (+0200)
+Subject: Add support for wpa_supplicant syslog output
+X-Git-Url: http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=commitdiff_plain;h=daa70d49de46278cf5a92b279d1d262af573cb63
+
+Add support for wpa_supplicant syslog output
+
+Enable for build: CFLAGS += -DCONFIG_DEBUG_SYSLOG in .config
+Enable at runtime: -s on command line
+---
+
+--- a/src/utils/wpa_debug.c
++++ b/src/utils/wpa_debug.c
+@@ -16,6 +16,12 @@
+ 
+ #include "common.h"
+ 
++#ifdef CONFIG_DEBUG_SYSLOG
++#include <syslog.h>
++
++static int wpa_debug_syslog = 0;
++#endif /* CONFIG_DEBUG_SYSLOG */
++
+ 
+ #ifdef CONFIG_DEBUG_FILE
+ static FILE *out_file = NULL;
+@@ -45,6 +51,39 @@ void wpa_debug_print_timestamp(void)
+ }
+ 
+ 
++#ifdef CONFIG_DEBUG_SYSLOG
++void wpa_debug_open_syslog(void)
++{
++	openlog("wpa_supplicant", LOG_PID | LOG_NDELAY, LOG_DAEMON);
++	wpa_debug_syslog++;
++}
++
++
++void wpa_debug_close_syslog(void)
++{
++	if (wpa_debug_syslog)
++		closelog();
++}
++
++
++static int syslog_priority(int level)
++{
++	switch (level) {
++	case MSG_MSGDUMP:
++	case MSG_DEBUG:
++		return LOG_DEBUG;
++	case MSG_INFO:
++		return LOG_NOTICE;
++	case MSG_WARNING:
++		return LOG_WARNING;
++	case MSG_ERROR:
++		return LOG_ERR;
++	}
++	return LOG_INFO;
++}
++#endif /* CONFIG_DEBUG_SYSLOG */
++
++
+ /**
+  * wpa_printf - conditional printf
+  * @level: priority level (MSG_*) of the message
+@@ -62,6 +101,11 @@ void wpa_printf(int level, char *fmt, ..
+ 
+ 	va_start(ap, fmt);
+ 	if (level >= wpa_debug_level) {
++#ifdef CONFIG_DEBUG_SYSLOG
++		if (wpa_debug_syslog) {
++			vsyslog(syslog_priority(level), fmt, ap);
++		} else {
++#endif /* CONFIG_DEBUG_SYSLOG */
+ 		wpa_debug_print_timestamp();
+ #ifdef CONFIG_DEBUG_FILE
+ 		if (out_file) {
+@@ -74,6 +118,9 @@ void wpa_printf(int level, char *fmt, ..
+ #ifdef CONFIG_DEBUG_FILE
+ 		}
+ #endif /* CONFIG_DEBUG_FILE */
++#ifdef CONFIG_DEBUG_SYSLOG
++		}
++#endif /* CONFIG_DEBUG_SYSLOG */
+ 	}
+ 	va_end(ap);
+ }
+--- a/src/utils/wpa_debug.h
++++ b/src/utils/wpa_debug.h
+@@ -205,6 +205,23 @@ enum hostapd_logger_level {
+ };
+ 
+ 
++#ifdef CONFIG_DEBUG_SYSLOG
++
++void wpa_debug_open_syslog(void);
++void wpa_debug_close_syslog(void);
++
++#else /* CONFIG_DEBUG_SYSLOG */
++
++static inline void wpa_debug_open_syslog(void)
++{
++}
++
++static inline void wpa_debug_close_syslog(void)
++{
++}
++
++#endif /* CONFIG_DEBUG_SYSLOG */
++
+ 
+ #ifdef EAPOL_TEST
+ #define WPA_ASSERT(a)						       \
+--- a/wpa_supplicant/main.c
++++ b/wpa_supplicant/main.c
+@@ -26,7 +26,7 @@ static void usage(void)
+ 	int i;
+ 	printf("%s\n\n%s\n"
+ 	       "usage:\n"
+-	       "  wpa_supplicant [-BddhKLqqtuvW] [-P<pid file>] "
++	       "  wpa_supplicant [-BddhKLqqstuvW] [-P<pid file>] "
+ 	       "[-g<global ctrl>] \\\n"
+ 	       "        -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] "
+ 	       "[-p<driver_param>] \\\n"
+@@ -52,27 +52,32 @@ static void usage(void)
+ 	       "  -C = ctrl_interface parameter (only used if -c is not)\n"
+ 	       "  -i = interface name\n"
+ 	       "  -d = increase debugging verbosity (-dd even more)\n"
+-	       "  -D = driver name (can be multiple drivers: nl80211,wext)\n"
++	       "  -D = driver name (can be multiple drivers: nl80211,wext)\n");
+ #ifdef CONFIG_DEBUG_FILE
+-	       "  -f = log output to debug file instead of stdout\n"
++	printf("  -f = log output to debug file instead of stdout\n");
+ #endif /* CONFIG_DEBUG_FILE */
+-	       "  -g = global ctrl_interface\n"
+-	       "  -K = include keys (passwords, etc.) in debug output\n"
+-	       "  -t = include timestamp in debug messages\n"
++	printf("  -g = global ctrl_interface\n"
++	       "  -K = include keys (passwords, etc.) in debug output\n");
++#ifdef CONFIG_DEBUG_SYSLOG
++	printf("  -s = log output to syslog instead of stdout\n");
++#endif /* CONFIG_DEBUG_SYSLOG */
++	printf("  -t = include timestamp in debug messages\n"
+ 	       "  -h = show this help text\n"
+-	       "  -L = show license (GPL and BSD)\n");
+-	printf("  -p = driver parameters\n"
++	       "  -L = show license (GPL and BSD)\n"
++	       "  -p = driver parameters\n"
+ 	       "  -P = PID file\n"
+-	       "  -q = decrease debugging verbosity (-qq even less)\n"
++	       "  -q = decrease debugging verbosity (-qq even less)\n");
+ #ifdef CONFIG_CTRL_IFACE_DBUS
+-	       "  -u = enable DBus control interface\n"
++	printf("  -u = enable DBus control interface\n");
+ #endif /* CONFIG_CTRL_IFACE_DBUS */
+-	       "  -v = show version\n"
++	printf("  -v = show version\n"
+ 	       "  -W = wait for a control interface monitor before starting\n"
+ 	       "  -N = start describing new interface\n");
+ 
+ 	printf("example:\n"
+-	       "  wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf\n");
++	       "  wpa_supplicant -D%s -iwlan0 -c/etc/wpa_supplicant.conf\n",
++	       wpa_supplicant_drivers[i] ?
++		   wpa_supplicant_drivers[i]->name : "wext");
+ #endif /* CONFIG_NO_STDOUT_DEBUG */
+ }
+ 
+@@ -133,7 +138,7 @@ int main(int argc, char *argv[])
+ 	wpa_supplicant_fd_workaround();
+ 
+ 	for (;;) {
+-		c = getopt(argc, argv, "b:Bc:C:D:df:g:hi:KLNp:P:qtuvW");
++		c = getopt(argc, argv, "b:Bc:C:D:df:g:hi:KLNp:P:qstuvW");
+ 		if (c < 0)
+ 			break;
+ 		switch (c) {
+@@ -194,6 +199,11 @@ int main(int argc, char *argv[])
+ 		case 'q':
+ 			params.wpa_debug_level++;
+ 			break;
++#ifdef CONFIG_DEBUG_SYSLOG
++		case 's':
++			params.wpa_debug_syslog++;
++			break;
++#endif /* CONFIG_DEBUG_SYSLOG */
+ 		case 't':
+ 			params.wpa_debug_timestamp++;
+ 			break;
+--- a/wpa_supplicant/wpa_supplicant.c
++++ b/wpa_supplicant/wpa_supplicant.c
+@@ -2024,6 +2024,8 @@ struct wpa_global * wpa_supplicant_init(
+ 		return NULL;
+ 
+ 	wpa_debug_open_file(params->wpa_debug_file_path);
++	if (params->wpa_debug_syslog)
++		wpa_debug_open_syslog();
+ 
+ 	ret = eap_peer_register_methods();
+ 	if (ret) {
+@@ -2174,5 +2176,6 @@ void wpa_supplicant_deinit(struct wpa_gl
+ 	os_free(global->params.ctrl_interface);
+ 
+ 	os_free(global);
++	wpa_debug_close_syslog();
+ 	wpa_debug_close_file();
+ }
+--- a/wpa_supplicant/wpa_supplicant_i.h
++++ b/wpa_supplicant/wpa_supplicant_i.h
+@@ -156,6 +156,11 @@ struct wpa_params {
+ 	 * wpa_debug_file_path - Path of debug file or %NULL to use stdout
+ 	 */
+ 	const char *wpa_debug_file_path;
++
++	/**
++	 * wpa_debug_syslog - Enable log output through syslog
++	 */
++	int wpa_debug_syslog;
+ };
+ 
+ /**

Modified: wpasupplicant/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/patches/series?rev=1345&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/patches/series (original)
+++ wpasupplicant/trunk/debian/patches/series Mon Mar 23 23:59:34 2009
@@ -1,6 +1,7 @@
 01_use_pkg-config_for_pcsc-lite_module.patch
 02_dbus_group_policy.patch
 03_dbus_service_activation_logfile.patch
-04_append_mmd_to_default_cflags.patch
 05_qmake_version_makefile.patch
 06_wpa_gui_menu_exec_path.patch
+10_multi_driver.patch
+11_syslog.patch

Modified: wpasupplicant/trunk/debian/rules
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/rules?rev=1345&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/rules (original)
+++ wpasupplicant/trunk/debian/rules Mon Mar 23 23:59:34 2009
@@ -7,7 +7,7 @@
 
 WPAGUI = wpa_gui-qt4
 
-CFLAGS = -Wall -g
+CFLAGS = -MMD -Wall -g
 LDFLAGS = -Wl,--as-needed
 
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))




More information about the Pkg-wpa-devel mailing list