mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-04 07:31:11 +00:00
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.
This commit is contained in:
parent
81b3da088a
commit
16f602c613
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=151223
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue