hostapd/src/drivers
Yi Zhu 23763c6516 bsd: Fix receive buffer alignment issue
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.
2010-12-30 16:13:19 +02:00
..
.gitignore Force rebuilding of src/drivers between hostapd and wpa_supplicant 2009-08-14 20:40:37 +03:00
Apple80211.h Added preliminary Wi-Fi Protected Setup (WPS) implementation 2008-11-23 19:34:26 +02:00
driver.h P2P: Add initial support for driver-based P2P management 2010-12-30 12:48:55 +02:00
driver_atheros.c atheros: Remove debug for ioctls that are not used anymore 2010-10-27 11:33:40 +03:00
driver_atmel.c Get rid of unnecessary typedefs for enums. 2009-12-26 10:35:08 +02:00
driver_broadcom.c Use generic driver event notification for AP mode assoc/disassoc 2010-01-03 18:22:22 +02:00
driver_bsd.c bsd: Fix receive buffer alignment issue 2010-12-30 16:13:19 +02:00
driver_hostap.c WPS 2.0: Provide (Re)Association Response WPS IE to driver 2010-09-22 10:46:44 -07:00
driver_hostap.h Merge wpa_supplicant and hostapd driver wrapper implementations 2009-04-09 13:40:12 +03:00
driver_iphone.m Remove src/crypto from default include path 2009-11-29 23:04:43 +02:00
driver_ipw.c Standardize on a single definition of auth_alg bitfield values 2010-01-03 21:14:40 +02:00
driver_madwifi.c driver_madwifi: fix a compile error on big endian systems 2010-11-09 15:53:56 +02:00
driver_ndis.c P2P: Add initial support for driver-based P2P management 2010-12-30 12:48:55 +02:00
driver_ndis.h driver_ndis: Detect Native 802.11 drivers (NDIS 6, Vista) 2009-03-07 23:53:40 +02:00
driver_ndis_.c Re-initialize hostapd/wpa_supplicant git repository based on 0.6.3 release 2008-02-27 17:34:43 -08:00
driver_ndiswrapper.c Get rid of unnecessary typedefs for enums. 2009-12-26 10:35:08 +02:00
driver_nl80211.c nl80211: Use driver-based off-channel TX if available 2010-12-29 14:05:34 +02:00
driver_none.c Remove src/common from default header file path 2009-11-29 17:51:55 +02:00
driver_osx.m driver_osx: Update set_key arguments to fix build 2010-04-04 08:13:46 +03:00
driver_privsep.c Add drv_event_eapol_rx() helper 2010-01-03 18:35:01 +02:00
driver_ralink.c Share a single Linux ioctl helper fo setting interface up/down 2010-01-03 22:08:26 +02:00
driver_ralink.h ralink: Add WPS support 2009-12-18 21:04:11 +02:00
driver_roboswitch.c driver_roboswitch: include net/if.h instead of linux/if.h 2010-11-09 15:55:34 +02:00
driver_test.c P2P: Add initial support for driver-based P2P management 2010-12-30 12:48:55 +02:00
driver_wext.c Enable sharing of scan result events among virtual interfaces 2010-11-26 21:46:30 +02:00
driver_wext.h Enable sharing of scan result events among virtual interfaces 2010-11-26 21:46:30 +02:00
driver_wired.c Solaris: Add support for wired IEEE 802.1X client 2010-08-28 11:40:07 +03:00
drivers.c driver_ps3: Remove legacy ps3 wpa driver 2010-02-08 21:08:54 +02:00
drivers.mak nl80211: Allow libnl to be replaced with libnl-tiny 2010-11-04 17:14:58 +02:00
linux_ioctl.c Make sure the resutl from readlink is properly null terminated 2010-01-16 17:19:06 +02:00
linux_ioctl.h hostapd: Detect bridge interface automatically 2010-01-16 15:19:58 +02:00
Makefile Remove unnecessary SUBDIRS loops from src/*/Makefile 2010-04-17 17:10:31 +03:00
MobileApple80211.c Re-initialize hostapd/wpa_supplicant git repository based on 0.6.3 release 2008-02-27 17:34:43 -08:00
MobileApple80211.h Re-initialize hostapd/wpa_supplicant git repository based on 0.6.3 release 2008-02-27 17:34:43 -08:00
ndis_events.c Workaround number of compiler warnings with newer MinGW version 2008-12-11 00:56:37 +02:00
netlink.c netlink: Move more of the newlink/dellink parsing into shared code 2009-12-18 17:49:07 +02:00
netlink.h nl80211: Include linux/rtnetlink.h explicitly 2010-09-29 21:52:51 -07:00
nl80211_copy.h nl80211: Sync definitions with wireless-testing.git 2010-12-17 13:07:32 +02:00
priv_netlink.h netlink: Use NLMSG_OK and NLMSG_NEXT macros 2009-12-18 17:22:35 +02:00
rfkill.c Add Linux rfkill support 2010-05-23 10:27:32 +03:00
rfkill.h Add Linux rfkill support 2010-05-23 10:27:32 +03:00
wireless_copy.h Remove src/common from default header file path 2009-11-29 17:51:55 +02:00