summaryrefslogtreecommitdiffstats
path: root/usr.sbin/wpa
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2005-10-10 20:40:28 +0000
committerwpaul <wpaul@FreeBSD.org>2005-10-10 20:40:28 +0000
commit020d6defa5f5cb6bd76c90cce2ca1c51c8fc81c3 (patch)
treeefba7d358b2aa16cda140f10010e6bc3539d1c90 /usr.sbin/wpa
parent2dc99f1bfba811c45838d9ab57dcfd1dd994e605 (diff)
downloadFreeBSD-src-020d6defa5f5cb6bd76c90cce2ca1c51c8fc81c3.zip
FreeBSD-src-020d6defa5f5cb6bd76c90cce2ca1c51c8fc81c3.tar.gz
Make forwarding of connect/disconnect events optional. wpa_supplicant
seems to already be able to tell when it's associated and the extra events just confuse it. Only forward media-specific events by default.
Diffstat (limited to 'usr.sbin/wpa')
-rw-r--r--usr.sbin/wpa/ndis_events/ndis_events.811
-rw-r--r--usr.sbin/wpa/ndis_events/ndis_events.c14
2 files changed, 22 insertions, 3 deletions
diff --git a/usr.sbin/wpa/ndis_events/ndis_events.8 b/usr.sbin/wpa/ndis_events/ndis_events.8
index 4735db0..983149f 100644
--- a/usr.sbin/wpa/ndis_events/ndis_events.8
+++ b/usr.sbin/wpa/ndis_events/ndis_events.8
@@ -41,6 +41,7 @@ drivers to
.Xr wpa_supplicant 8
.Sh SYNOPSIS
.Nm
+.Op Fl a
.Op Fl d
.Op Fl v
.Sh DESCRIPTION
@@ -90,6 +91,16 @@ The
.Nm
daemon supports the following options:
.Bl -tag -width indent
+.It Fl a
+Process all events. By default,
+.Nm
+will only process and forward media-specific events, which contain
+PMKID candidate information, and not bother forwarding connect and
+disconnect events, since
+.Xr wpa_supplicant 8
+normally can determine the current link state on its own. In some
+cases, the additional connect and disconnect events only confuse it
+and make the association and authentication process take longer.
.It Fl d
Run in debug mode. This causes
.Nm
diff --git a/usr.sbin/wpa/ndis_events/ndis_events.c b/usr.sbin/wpa/ndis_events/ndis_events.c
index 1741a64..6180c88 100644
--- a/usr.sbin/wpa/ndis_events/ndis_events.c
+++ b/usr.sbin/wpa/ndis_events/ndis_events.c
@@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$");
static int verbose = 0;
static int debug = 0;
+static int all_events = 0;
#define PROGNAME "ndis_events"
@@ -189,7 +190,7 @@ announce_event(ifname, sock, dst)
if (ioctl(s, SIOCGPRIVATE_0, &ifr) < 0) {
close(s);
- dbgmsg("failed to read event info from %s\n", ifname);
+ dbgmsg("failed to read event info from %s: %d", ifname, errno);
return;
}
@@ -197,11 +198,15 @@ announce_event(ifname, sock, dst)
type = EVENT_CONNECT;
if (verbose)
dbgmsg("Received a connect event for %s", ifname);
+ if (!all_events)
+ return;
}
if (e->ne_sts == NDIS_STATUS_MEDIA_DISCONNECT) {
type = EVENT_DISCONNECT;
if (verbose)
dbgmsg("Received a disconnect event for %s", ifname);
+ if (!all_events)
+ return;
}
if (e->ne_sts == NDIS_STATUS_MEDIA_SPECIFIC_INDICATION) {
type = EVENT_MEDIA_SPECIFIC;
@@ -244,7 +249,7 @@ static void
usage(progname)
char *progname;
{
- fprintf(stderr, "Usage: ndis_events [-d] [-v]\n", progname);
+ fprintf(stderr, "Usage: ndis_events [-a] [-d] [-v]\n", progname);
exit(1);
}
@@ -261,7 +266,7 @@ main(argc, argv)
char ifname[IFNAMSIZ];
int ch;
- while ((ch = getopt(argc, argv, "dv")) != -1) {
+ while ((ch = getopt(argc, argv, "dva")) != -1) {
switch(ch) {
case 'd':
debug++;
@@ -269,6 +274,9 @@ main(argc, argv)
case 'v':
verbose++;
break;
+ case 'a':
+ all_events++;
+ break;
default:
usage(PROGNAME);
break;
OpenPOWER on IntegriCloud