aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/driver_bsd.c
Commit message (Collapse)AuthorAgeFilesLines
* bsd: Fix set_key() sequence number endian issueZhu Yi2011-06-231-1/+13
| | | | | | | | In set_key handler, the seq[8] is in little endian order defined by WPA. BSD kernel uses a u_int64_t value ik_keyrsc to represent it internally. The kernel expects the native endian order for the value. Thus, we need to detect the endian order and swap bytes when necessary.
* bsd: Add support for setting HT values in IFM_MMASKYi Zhu2011-04-141-5/+14
|
* bsd: Fix buffer size for routing socket with IPv6 disabledYi Zhu2011-04-121-7/+3
| | | | | | AF_INET6 is not always enabled by default, so use AF_INET instead. In addition, use the old fixed length, 2048, as a failover value if the sysctl fails for any reason.
* nl80211: Send EAPOL frames as QoS data frames for QoS aware clientsFelix Fietkau2011-04-021-1/+1
| | | | | | | | | | | This should fix EAPOL reauthentication and rekeying timeout issues with Intel clients when using WMM (e.g., with IEEE 802.11n). These stations do not seem to be able to handle EAPOL data frames as non-QoS Data frames after the initial setup. This adds STA flags to hapd_send_eapol() driver op to allow driver_nl80211.c to mark the EAPOL frames as QoS Data frame when injecting it through the monitor interface.
* Indicate assoc vs. reassoc in association eventShan Palanisamy2011-03-061-1/+1
| | | | | | This allows driver wrappers to indicate whether the association was done using Association Request/Response or with Reassociation Request/Response frames.
* bsd: Use correct size for routing socketMasashi Honma2011-02-271-12/+57
| | | | | | | The buffer size for routing socket is fixed to 2048. This patch fix it to obtain the size from OS. This patch worked on x86 platform with NetBSD 5.0.2.
* Use set_key addr to distinguish default and multicast keysJouni Malinen2011-01-091-5/+2
| | | | | | | | Previously, both NULL and ff:ff:ff:ff:ff:ff addr were used in various places to indicate default/broadcast keys. Make this more consistent and useful by defining NULL to mean default key (i.e., used both for unicast and broadcast) and ff:ff:ff:ff:ff:ff to indicate broadcast key (i.e., used only with broadcast).
* Use more consistent set_key seq value when nothing is being setJouni Malinen2011-01-091-1/+2
| | | | | | Use NULL instead of (u8 *) "" as the seq value and make sure the driver wrapper implementations can handle NULL value. This was previously already done in number of places, but not everywhere.
* bsd: Fix receive buffer alignment issueYi Zhu2010-12-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | wpa_supplicant seems to crash from time to time on a NetBSD 4.0 MIPS platform. The root cause turned out to be a MIPS alignment issue. In my wpa_supplicant crash case, in function wpa_driver_bsd_event_receive (from driver_bsd.c), the buf[2048] address is started from i.e. 0x7fffd546, which is not 4 bytes aligned. Later when it is casted to (struct if_msghdr *), and rtm->rtm_flags is used. rtm->rtm_flags is "int" type, but its address is not 4 bytes aligned. This is because the start address of rtm is not 4 bytes aligned. Unfortunately in NetBSD MIPS kernel (unlike Linux MIPS kernel emulates unaligned access in its exception handler), the default behavior is to generate a memory fault to the application that accesses unaligned memory address. Thus comes the early mentioned wpa_supplicant crash. An interesting note is when I'm using the wpa_supplicant version 0.4.9, I never saw this problem. Maybe the stack layout is different. But I didn't look into details. I used below patch to resolve this problem. Now it runs correctly for at least several hours. But you might have a better fix (maybe we can use malloc/free so that it is at least cache line aligned?). I'm also not sure if other drivers should have the same problem.
* Fix driver_bsd.c compile errorYi Zhu2010-12-301-0/+1
| | | | | I got an error for WPA_KEY_RSC_LEN is not defined when compiling the driver_bsd.c on NetBSD 4.0. Below patch fixed it.
* bsd: Use set_freq() API for AP mode wpa_supplicantMasashi Honma2010-05-231-22/+4
| | | | | | | Previous version driver_bsd.c switches the channel in wpa_driver_bsd_associate(). This patch changes it to use set_freq(). I have tested this patch on FreeBSD 8.0/NetBSD 5.0.2 with hostapd, wpa_supplicant(AP) and wpa_supplicant(STA).
* NetBSD: Fix driver_bsd.c buildMasashi Honma2010-03-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | On NetBSD 5.0.2, wpa_supplicant build results in messages below. ../src/drivers/driver_bsd.c: In function 'wpa_driver_bsd_get_ssid': ../src/drivers/driver_bsd.c:876: warning: passing argument 2 of 'bsd_get_ssid' from incompatible pointer type ../src/drivers/driver_bsd.c:876: warning: passing argument 3 of 'bsd_get_ssid' makes integer from pointer without a cast ../src/drivers/driver_bsd.c:876: error: too many arguments to function 'bsd_get_ssid' ../src/drivers/driver_bsd.c: In function 'wpa_driver_bsd_scan': ../src/drivers/driver_bsd.c:1125: warning: passing argument 2 of 'bsd_set_ssid' from incompatible pointer type ../src/drivers/driver_bsd.c:1125: warning: passing argument 3 of 'bsd_set_ssid' makes integer from pointer without a cast ../src/drivers/driver_bsd.c:1125: error: too many arguments to function 'bsd_set_ssid' gmake: *** [../src/drivers/driver_bsd.o] Error 1 This patch solves this issue.
* Remove unnecessary ifname parameter to sta_set_flags() driver opJouni Malinen2010-03-071-1/+1
|
* Remove unnecessary ifname parameter from hapd_get_ssid/hapd_set_ssidJouni Malinen2010-03-071-2/+2
|
* Remove unnecessary ifname parameter from set_generic_elem() driver opJouni Malinen2010-03-071-2/+2
|
* Remove unneeded ifname parameter from set_privacy() driver opJouni Malinen2010-03-071-1/+1
|
* hostapd: add ifname to the sta_set_flags callbackFelix Fietkau2010-03-061-2/+2
| | | | | This fixes multi-BSS STA operations (e.g., setting AUTHORIZED flag) with nl80211-based drivers.
* wpa_supplicant: fix FTBFS on Debian GNU/kFreeBSDKel Modderman2010-03-061-2/+5
| | | | | | | | This patch allows wpa_supplicant to compile on Debian's kfreebsd architectures. Patch by Stefan Lippers-Hollmann based on work done by Petr Salinger and Emmanuel Bouthenot for 0.6.X (http://bugs.debian.org/480572).
* bsd: Use os_strlcpy instead of strlcpyJouni Malinen2010-03-061-4/+4
|
* bsd: Use device capability informationMasashi Honma2010-02-161-5/+57
| | | | | This patch enables the use of device capability information from the driver when possible.
* bsd: Aggregate ioctl routinesMasashi Honma2010-02-131-58/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch aggregates ioctls. First is SIOCS80211. The SIOCS80211's arguments has 3 couples. 1-1. i_len, i_data 1-2. i_val 1-3. i_len, i_data, i_val (currently only IEEE80211_IOC_APPIE) There were 3 routines for each cases. This patch aggregates these to one. Second is SIOCG80211. The SIOCG80211 returns 2 type of value. 2-1. i_len 2-2. i_val There were 2 routines for each cases. This patch aggregates these to one. I have tested on both FreeBSD 8.0 and NetBSD 5.0.1 with these cases. [hostapd] RSN-PSK(CCMP)/WPA-PSK(TKIP) [wpa_supplicant(STA)] RSN-PSK(CCMP)/WPA-PSK(TKIP) [wpa_supplicant(AP)] RSN-PSK(CCMP)/WPA-PSK(TKIP)
* FreeBSD: Add support for FreeBSD 8.0 STA/APMasashi Honma2010-02-131-23/+69
| | | | | | | | | | | | | | | | | | | | | | This patch adds both wpa_supplicant and hostapd support for FreeBSD 8.0. I refered http://www.jp.freebsd.org/cgi/cvsweb.cgi/src/usr.sbin/wpa/hostapd/driver_freebsd .c http://www.jp.freebsd.org/cgi/cvsweb.cgi/src/usr.sbin/wpa/wpa_supplicant/driver_ freebsd.c I have tested on FreeBSD 8.0 with these cases. [hostapd] RSN-PSK(CCMP)/WPA-PSK(TKIP) [wpa_supplicant(STA)] RSN-PSK(CCMP)/WPA-PSK(TKIP) [wpa_supplicant(AP)] RSN-PSK(CCMP)/WPA-PSK(TKIP)
* FreeBSD: Enable channel controlMasashi Honma2010-02-131-5/+5
| | | | | | | | | | | | | | | This patch enables FreeBSD channel control. I have tested on FreeBSD 7.2 with these cases. [hostapd] RSN-PSK(CCMP)/WPA-PSK(TKIP) [wpa_supplicant(STA)] RSN-PSK(CCMP)/WPA-PSK(TKIP) [wpa_supplicant(AP)] RSN-PSK(CCMP)/WPA-PSK(TKIP)
* bsd: Unify wpa_driver_bsd_opsMasashi Honma2010-02-131-324/+145
| | | | | | | | | | | | | | | | The attached patch unifies hostapd wpa_driver_bsd_ops and wpa_supplicant wpa_driver_bsd_ops. I have tested on NetBSD 5.0.1 with these cases. [hostapd] RSN-PSK(CCMP)/WPA-PSK(TKIP) [wpa_supplicant(STA)] RSN-PSK(CCMP)/WPA-PSK(TKIP) [wpa_supplicant(AP)] RSN-PSK(CCMP)/WPA-PSK(TKIP)
* bsd: Unify struct bsd_driver_data and struct wpa_driver_bsd_dataMasashi Honma2010-02-131-63/+45
| | | | This patch unifies struct bsd_driver_data and struct wpa_driver_bsd_data.
* bsd: Use same field name between hostapd and wpa_supplicantMasashi Honma2010-02-131-54/+36
| | | | | | This patch modifies field name of struct bsd_driver_data to use same name of struct wpa_driver_bsd_data. This is a preparation of unifying struct bsd_driver_data and struct wpa_driver_bsd_data.
* driver_bsd: Fix build without SIOCS80211CHANNELJouni Malinen2010-02-081-0/+6
| | | | | At least FreeBSD 7 does not seem to define this and failed to build after the previous changes.
* driver_bsd.c: Enable AP mode wpa_supplicantMasashi Honma2010-02-081-163/+348
|
* driver_bsd: Clean up EAPOL frame transmission codeMasashi Honma2010-02-081-33/+5
| | | | | | | The bsd_send_eapol() adds Ethernet header by itself. This patch changes it to use l2_packet functionality. I have tested on NetBSD 5.0.1 with WPA-PSK(TKIP).
* driver_bsd.c: Reduce code duplication (setkey)Masashi Honma2010-02-081-113/+75
| | | | | This patch reduces code duplication between hostapd and wpa_supplicant for IEEE80211_IOC_WPAKEY.
* driver_bsd.c: Reduce code duplication (ifflag)Masashi Honma2010-02-081-67/+41
| | | | | This patch reduces code duplication between hostapd and wpa_supplicant for SIOC[GS]IFFLAGS.
* driver_bsd.c: Reduce code duplication (MLME)Masashi Honma2010-02-081-41/+25
| | | | | | This patch reduces code duplication between hostapd and wpa_supplicant about IEEE80211_IOC_MLME. This is a preparation for AP mode wpa_supplicant.
* driver_bsd.c: Reduce code duplication (DELKEY)Masashi Honma2010-02-081-45/+25
| | | | | | | This patch reduces code duplication between hostapd and wpa_supplicant about IEEE80211_IOC_DELKEY. This is a preparation for AP mode wpa_supplicant. This is a patch to http://lists.shmoo.com/pipermail/hostap/2010-January/021030.html.
* bsd: Enable auto configurationMasashi Honma2010-02-081-0/+91
| | | | | | | | | | | | | | | | | | | On NetBSD, we should configure some parameters manually out of hostapd like below. ifconfig ath0 mediaopt hostap ifconfig ath0 mode 11g ifconfig ath0 chan 6 This patch does these automatically. Maybe there will be some objections, like "hardware configuration is not hostapd/wpa_supplican's work". So I will write the reasons why I made this patch. 1. For usability. 2. The first command fails when previous state is adhoc. This patch is free from previous state. 3. Some driver wrappers configure these automatically (like nl80211). 4. I have wasted time trying to find out these command were needed :(
* driver_bsd.c: Use os_free() instead of free()Masashi Honma2010-02-081-2/+2
| | | | | This patch replaces some free() with os_free() when the memory was allocated by os_*().
* driver_bsd.c: Clean up EAPOL frame transmission codeMasashi Honma2010-01-161-15/+11
| | | | | | The bsd_send_eapol() prepares 3000 bytes buffer for every EAPOL frame transmission. I think malloc() is better way for efficient memory use.
* FreeBSD: Fix driver_bsd.c buildMasashi Honma2010-01-091-1/+5
| | | | | | | | | | | | | | | | | | On FreeBSD 8.0, driver_bsd.c build fails because of changes from older versions of FreeBSD. The error messages are below: In file included from ../src/drivers/driver_bsd.c:38: /usr/include/net80211/ieee80211_crypto.h:94: error: 'IEEE80211_TID_SIZE' undeclared here (not in a function) ../src/drivers/driver_bsd.c: In function 'wpa_driver_bsd_set_wpa_ie': ../src/drivers/driver_bsd.c:968: error: 'IEEE80211_IOC_OPTIE' undeclared (first use in this function) ../src/drivers/driver_bsd.c:968: error: (Each undeclared identifier is reported only once ../src/drivers/driver_bsd.c:968: error: for each function it appears in.) gmake: *** [../src/drivers/driver_bsd.o] Error 1 This patch solves this issue.
* bsd: Fix a typoJouni Malinen2010-01-031-1/+1
|
* Standardize on a single definition of auth_alg bitfield valuesJouni Malinen2010-01-031-3/+3
|
* Add drv_event_eapol_rx() helperJouni Malinen2010-01-031-6/+2
|
* Use generic driver event notification for AP mode assoc/disassocJouni Malinen2010-01-031-3/+3
|
* Use driver event, EVENT_EAPOL_RX, for EAPOL frame indicationJouni Malinen2010-01-031-3/+6
|
* Get rid of unnecessary typedefs for enums.Jouni Malinen2009-12-261-2/+2
|
* Replace hostapd_michael_mic_failure() with generic driver eventJouni Malinen2009-12-131-2/+6
|
* Map STA flags into values defined in driver.hJouni Malinen2009-12-131-3/+2
| | | | | | This removes need for including hostapd/sta_flags.h into driver wrappers and removes any remaining dependencies between driver flags and internal hostapd flags.
* driver_bsd: Fix build after previous commitJouni Malinen2009-12-121-1/+1
|
* Add more WPA/IEEE 802.1X parameters into set_ieee8021x() driver opJouni Malinen2009-12-121-30/+24
| | | | | This gets rid of the need to touch internal hostapd data structures directly from the driver wrappers.
* driver_bsd: Fix build (eapol_sm.h is not needed anymore)Jouni Malinen2009-12-121-1/+0
|
* Change set_ieee8021x driver op to use parameters structureJouni Malinen2009-12-121-1/+2
| | | | | This makes it easier to extent the set of parameters passed to this driver wrapper function.
* Fix driver_bsd.c buildMasashi Honma2009-12-071-17/+17
| | | | | | | | | | | | | On NetBSD 5.0.1, driver_bsd.c build fails with message below. ../src/drivers/driver_bsd.c: In function 'wpa_driver_bsd_associate': ../src/drivers/driver_bsd.c:1170: warning: implicit declaration of function 'wpa_driver_bsd_set_auth_alg' ../src/drivers/driver_bsd.c: At top level: ../src/drivers/driver_bsd.c:1204: error: static declaration of 'wpa_driver_bsd_set_auth_alg' follows non-static declaration ../src/drivers/driver_bsd.c:1170: error: previous implicit declaration of 'wpa_driver_bsd_set_auth_alg' was here gmake: *** [../src/drivers/driver_bsd.o] Error 1 This patch solves this issue.