summaryrefslogtreecommitdiffstats
path: root/contrib/wpa/wpa_supplicant
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2009-03-02 02:26:53 +0000
committersam <sam@FreeBSD.org>2009-03-02 02:26:53 +0000
commit3cac7b891b7108169f5fed3997e777b56c060178 (patch)
tree9a4702b2a6316a180fa6909823635da3b5aa8524 /contrib/wpa/wpa_supplicant
parent2af41b09fa9d6ff3f4c736a224f545663be143d2 (diff)
downloadFreeBSD-src-3cac7b891b7108169f5fed3997e777b56c060178.zip
FreeBSD-src-3cac7b891b7108169f5fed3997e777b56c060178.tar.gz
bring in local changes for:
CONFIG_DEBUG_SYSLOG CONFIG_TERMINATE_ONLASTIF EAP_SERVER
Diffstat (limited to 'contrib/wpa/wpa_supplicant')
-rw-r--r--contrib/wpa/wpa_supplicant/events.c17
-rw-r--r--contrib/wpa/wpa_supplicant/main.c30
-rw-r--r--contrib/wpa/wpa_supplicant/wpa_supplicant.c3
-rw-r--r--contrib/wpa/wpa_supplicant/wpa_supplicant_i.h5
4 files changed, 51 insertions, 4 deletions
diff --git a/contrib/wpa/wpa_supplicant/events.c b/contrib/wpa/wpa_supplicant/events.c
index dd4595a..d3c785f 100644
--- a/contrib/wpa/wpa_supplicant/events.c
+++ b/contrib/wpa/wpa_supplicant/events.c
@@ -1011,6 +1011,18 @@ wpa_supplicant_event_michael_mic_failure(struct wpa_supplicant *wpa_s,
}
+#ifdef CONFIG_TERMINATE_ONLASTIF
+static int any_interfaces(struct wpa_supplicant *head)
+{
+ struct wpa_supplicant *wpa_s;
+
+ for (wpa_s = head; wpa_s != NULL; wpa_s = wpa_s->next)
+ if (!wpa_s->interface_removed)
+ return 1;
+ return 0;
+}
+#endif /* CONFIG_TERMINATE_ONLASTIF */
+
static void
wpa_supplicant_event_interface_status(struct wpa_supplicant *wpa_s,
union wpa_event_data *data)
@@ -1035,6 +1047,11 @@ wpa_supplicant_event_interface_status(struct wpa_supplicant *wpa_s,
wpa_supplicant_mark_disassoc(wpa_s);
l2_packet_deinit(wpa_s->l2);
wpa_s->l2 = NULL;
+#ifdef CONFIG_TERMINATE_ONLASTIF
+ /* check if last interface */
+ if (!any_interfaces(wpa_s->global->ifaces))
+ eloop_terminate();
+#endif /* CONFIG_TERMINATE_ONLASTIF */
break;
}
}
diff --git a/contrib/wpa/wpa_supplicant/main.c b/contrib/wpa/wpa_supplicant/main.c
index 6f90cc5..1f413f1 100644
--- a/contrib/wpa/wpa_supplicant/main.c
+++ b/contrib/wpa/wpa_supplicant/main.c
@@ -26,11 +26,23 @@ static void usage(void)
int i;
printf("%s\n\n%s\n"
"usage:\n"
- " wpa_supplicant [-BddhKLqqtuvW] [-P<pid file>] "
+ " wpa_supplicant [-BddhKLqq"
+#ifdef CONFIG_DEBUG_SYSLOG
+ "s"
+#endif /* CONFIG_DEBUG_SYSLOG */
+ "t"
+#ifdef CONFIG_CTRL_IFACE_DBUS
+ "u"
+#endif /* CONFIG_CTRL_IFACE_DBUS */
+ "vW] [-P<pid file>] "
"[-g<global ctrl>] \\\n"
" -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] "
"[-p<driver_param>] \\\n"
- " [-b<br_ifname>] [-f<debug file>] \\\n"
+ " [-b<br_ifname>]"
+#ifdef CONFIG_DEBUG_FILE
+ " [-f<debug file>]"
+#endif /* CONFIG_DEBUG_FILE */
+ " \\\n"
" [-N -i<ifname> -c<conf> [-C<ctrl>] "
"[-D<driver>] \\\n"
" [-p<driver_param>] [-b<br_ifname>] ...]\n"
@@ -58,6 +70,9 @@ static void usage(void)
#endif /* CONFIG_DEBUG_FILE */
" -g = global ctrl_interface\n"
" -K = include keys (passwords, etc.) in debug output\n"
+#ifdef CONFIG_DEBUG_SYSLOG
+ " -s = log output to syslog instead of stdout\n"
+#endif /* CONFIG_DEBUG_SYSLOG */
" -t = include timestamp in debug messages\n"
" -h = show this help text\n"
" -L = show license (GPL and BSD)\n");
@@ -72,7 +87,9 @@ static void usage(void)
" -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 +150,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 +211,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;
diff --git a/contrib/wpa/wpa_supplicant/wpa_supplicant.c b/contrib/wpa/wpa_supplicant/wpa_supplicant.c
index c1f95cb..b472eb3 100644
--- a/contrib/wpa/wpa_supplicant/wpa_supplicant.c
+++ b/contrib/wpa/wpa_supplicant/wpa_supplicant.c
@@ -2016,6 +2016,8 @@ struct wpa_global * wpa_supplicant_init(struct wpa_params *params)
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) {
@@ -2166,5 +2168,6 @@ void wpa_supplicant_deinit(struct wpa_global *global)
os_free(global->params.ctrl_interface);
os_free(global);
+ wpa_debug_close_syslog();
wpa_debug_close_file();
}
diff --git a/contrib/wpa/wpa_supplicant/wpa_supplicant_i.h b/contrib/wpa/wpa_supplicant/wpa_supplicant_i.h
index 5e4dcc1..71db428 100644
--- a/contrib/wpa/wpa_supplicant/wpa_supplicant_i.h
+++ b/contrib/wpa/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
+ */
+ const char *wpa_debug_syslog;
};
/**
OpenPOWER on IntegriCloud