update for wpa_supplicant 0.5.8 import:

o unix domain socket to wpa_cli is configured w/ CONFIG_CTRL_IFACE_UNIX
o terminate on last interface option is configured w/ CONFIG_TERMINATE_ONLASTIF
o ndis/Packet32.c fixups to force roaming mode to manual
o document new mixed_cell config knob

Submitted by:	thompsa (Packet32.c)
Reviewed by:	thompsa, sephe
Approved by:	re (hrs)
This commit is contained in:
Sam Leffler 2007-07-11 16:04:08 +00:00
parent 2d762fe9ef
commit f5d5722e6d
5 changed files with 48 additions and 6 deletions

View File

@ -4,8 +4,11 @@ WPA_SUPPLICANT_DISTDIR?= ${.CURDIR}/../../../contrib/wpa_supplicant
.PATH: ${WPA_SUPPLICANT_DISTDIR}
PROG= wpa_cli
SRCS= wpa_cli.c wpa_ctrl.c
SRCS= wpa_cli.c wpa_ctrl.c os_unix.c
MAN= wpa_cli.8
CFLAGS+= -DCONFIG_CTRL_IFACE
CFLAGS+= -DCONFIG_CTRL_IFACE_UNIX
.include <bsd.prog.mk>

View File

@ -6,6 +6,9 @@ WPA_SUPPLICANT_DISTDIR?= ${.CURDIR}/../../../contrib/wpa_supplicant
PROG= wpa_passphrase
SRCS= wpa_passphrase.c sha1.c md5.c
CFLAGS+= -DINTERNAL_SHA1
CFLAGS+= -DINTERNAL_MD5
MAN= wpa_passphrase.8
.include <bsd.prog.mk>

View File

@ -7,9 +7,11 @@ WPA_SUPPLICANT_DISTDIR?= ${.CURDIR}/../../../contrib/wpa_supplicant
PROG= wpa_supplicant
SRCS= config.c eloop.c common.c md5.c rc4.c sha1.c aes_wrap.c \
wpa_supplicant.c events.c wpa.c preauth.c \
ctrl_iface.c l2_packet.c main.c drivers.c driver_freebsd.c \
driver_ndis.c driver_ndis_.c Packet32.c
wpa_supplicant.c events.c wpa.c preauth.c pmksa_cache.c \
ctrl_iface.c ctrl_iface_unix.c l2_packet.c main.c drivers.c \
driver_ndis.c Packet32.c \
driver_freebsd.c os_unix.c
MAN= wpa_supplicant.8 wpa_supplicant.conf.5
@ -17,6 +19,8 @@ CFLAGS+= -I${.CURDIR} -I${WPA_SUPPLICANT_DISTDIR}
CFLAGS+= -DCONFIG_DRIVER_BSD
CFLAGS+= -DCONFIG_DRIVER_NDIS
CFLAGS+= -DCONFIG_CTRL_IFACE
CFLAGS+= -DCONFIG_CTRL_IFACE_UNIX
CFLAGS+= -DCONFIG_TERMINATE_ONLASTIF
CFLAGS+= -g
DPADD+= ${LIBPCAP}
LDADD+= -lpcap
@ -26,7 +30,7 @@ SRCS+= config_file.c base64.c
CFLAGS+=-DCONFIG_BACKEND_FILE
.if ${MK_WPA_SUPPLICANT_EAPOL} != "no"
SRCS+= eapol_sm.c eap.c
SRCS+= eapol_sm.c eap.c eap_methods.c
CFLAGS+= -DIEEE8021X_EAPOL
.if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH)

View File

@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$");
#include <netdb.h>
#include <net/route.h>
#include <net80211/ieee80211_ioctl.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@ -97,6 +99,7 @@ typedef struct NDIS_802_11_KEY_COMPAT {
struct adapter {
int socket;
char name[IFNAMSIZ];
int prev_roaming;
};
PCHAR
@ -113,6 +116,7 @@ PacketOpenAdapter(iface)
int s;
int ifflags;
struct ifreq ifr;
struct ieee80211req ireq;
s = socket(PF_INET, SOCK_DGRAM, 0);
@ -124,8 +128,24 @@ PacketOpenAdapter(iface)
return(NULL);
a->socket = s;
if (strncmp(iface, "\\Device\\NPF_", 12) == 0)
iface += 12;
else if (strncmp(iface, "\\DEVICE\\", 8) == 0)
iface += 8;
snprintf(a->name, IFNAMSIZ, "%s", iface);
/* Turn off net80211 roaming */
bzero((char *)&ireq, sizeof(ireq));
strncpy(ireq.i_name, iface, sizeof (ifr.ifr_name));
ireq.i_type = IEEE80211_IOC_ROAMING;
if (ioctl(a->socket, SIOCG80211, &ireq) == 0) {
a->prev_roaming = ireq.i_val;
ireq.i_val = IEEE80211_ROAMING_MANUAL;
if (ioctl(a->socket, SIOCS80211, &ireq) < 0)
fprintf(stderr,
"Could not set IEEE80211_ROAMING_MANUAL\n");
}
bzero((char *)&ifr, sizeof(ifr));
strncpy(ifr.ifr_name, iface, sizeof (ifr.ifr_name));
if (ioctl(a->socket, SIOCGIFFLAGS, (caddr_t)&ifr) < 0) {
@ -326,12 +346,20 @@ PacketCloseAdapter(iface)
{
struct adapter *a;
struct ifreq ifr;
struct ieee80211req ireq;
if (iface == NULL)
return;
a = iface;
/* Reset net80211 roaming */
bzero((char *)&ireq, sizeof(ireq));
strncpy(ireq.i_name, a->name, sizeof (ifr.ifr_name));
ireq.i_type = IEEE80211_IOC_ROAMING;
ireq.i_val = a->prev_roaming;
ioctl(a->socket, SIOCS80211, &ireq);
bzero((char *)&ifr, sizeof(ifr));
strncpy(ifr.ifr_name, a->name, sizeof (ifr.ifr_name));
ioctl(a->socket, SIOCGIFFLAGS, (caddr_t)&ifr);

View File

@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd February 14, 2006
.Dd July 8, 2007
.Dt WPA_SUPPLICANT.CONF 5
.Os
.Sh NAME
@ -263,6 +263,10 @@ Identity string for EAP.
.It Va anonymous_identity
Anonymous identity string for EAP (to be used as the unencrypted identity
with EAP types that support different tunneled identities; e.g.\& EAP-TTLS).
.It Va mixed_cell
Configure whether networks that allow both plaintext and encryption
are allowed when selecting a BSS from the scan results.
By default this is set to 0 (disabled).
.It Va password
Password string for EAP.
.It Va ca_cert