aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/driver_atheros.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-01-16 13:19:58 (GMT)
committerJouni Malinen <j@w1.fi>2010-01-16 13:19:58 (GMT)
commit94627f6cc8be8693b6c6a7a6407fcf94ba0a7edb (patch)
treea17034718c8d9d941a1cf7c39270ec5f42dea1f1 /src/drivers/driver_atheros.c
parentd455d0806ed30cd471937d445f4d840017f25758 (diff)
downloadhostap-94627f6cc8be8693b6c6a7a6407fcf94ba0a7edb.zip
hostap-94627f6cc8be8693b6c6a7a6407fcf94ba0a7edb.tar.gz
hostap-94627f6cc8be8693b6c6a7a6407fcf94ba0a7edb.tar.bz2
hostapd: Detect bridge interface automatically
This makes the bridge parameter unnecessary for cases where the interface is already in a bridge and sysfs is mounted to /sys so that the detection code works. For nl80211, the bridge parameter can be used to request the AP interface to be added to the bridge automatically (brctl may refuse to do this before hostapd has been started to change the interface mode). If needed, the bridge interface is also created.
Diffstat (limited to 'src/drivers/driver_atheros.c')
-rw-r--r--src/drivers/driver_atheros.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/drivers/driver_atheros.c b/src/drivers/driver_atheros.c
index 4428731..f24a40f 100644
--- a/src/drivers/driver_atheros.c
+++ b/src/drivers/driver_atheros.c
@@ -1049,6 +1049,7 @@ madwifi_init(struct hostapd_data *hapd, struct wpa_init_params *params)
struct madwifi_driver_data *drv;
struct ifreq ifr;
struct iwreq iwr;
+ char brname[IFNAMSIZ];
drv = os_zalloc(sizeof(struct madwifi_driver_data));
if (drv == NULL) {
@@ -1086,6 +1087,13 @@ madwifi_init(struct hostapd_data *hapd, struct wpa_init_params *params)
1);
if (drv->sock_recv == NULL)
goto bad;
+ } else if (linux_br_get(brname, drv->iface) == 0) {
+ wpa_printf(MSG_DEBUG, "Interface in bridge %s; configure for "
+ "EAPOL receive", brname);
+ drv->sock_recv = l2_packet_init(brname, NULL, ETH_P_EAPOL,
+ handle_read, drv, 1);
+ if (drv->sock_recv == NULL)
+ goto bad;
} else
drv->sock_recv = drv->sock_xmit;