mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-12-18 22:21:52 +02:00
7438476abb
hapd->driver->set_operstate may happen when the drv_priv data is not initialized yet, this leads to a null pointer deref in the atheros driver. Protect the operstate call with a check for hapd->drv_priv. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23715 3c298f89-4303-0410-b956-a3cf2f4a3e73
48 lines
1.6 KiB
Diff
48 lines
1.6 KiB
Diff
From: Jouni Malinen <jouni.malinen@atheros.com>
|
|
Date: Tue, 26 Oct 2010 13:30:28 +0000 (+0300)
|
|
Subject: hostapd: Set operstate UP when initializing AP mode
|
|
X-Git-Url: http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=commitdiff_plain;h=e11f5a2cbc333113a3a1cc1aeea7f698c3936ca3
|
|
|
|
hostapd: Set operstate UP when initializing AP mode
|
|
|
|
This is needed to avoid problems with other applications setting and
|
|
leaving the interface to IF_OPER_DORMANT state. In AP mode, the interface
|
|
is ready immediately after the keys are set, so we better make sure the
|
|
DORMANT state does not prevent normal operations after that.
|
|
---
|
|
|
|
--- a/src/ap/hostapd.c
|
|
+++ b/src/ap/hostapd.c
|
|
@@ -622,6 +622,9 @@ static int hostapd_setup_bss(struct host
|
|
|
|
ieee802_11_set_beacon(hapd);
|
|
|
|
+ if (hapd->driver && hapd->driver->set_operstate)
|
|
+ hapd->driver->set_operstate(hapd->drv_priv, 1);
|
|
+
|
|
return 0;
|
|
}
|
|
|
|
--- a/src/drivers/driver_wext.c
|
|
+++ b/src/drivers/driver_wext.c
|
|
@@ -2245,11 +2245,14 @@ int wpa_driver_wext_set_operstate(void *
|
|
{
|
|
struct wpa_driver_wext_data *drv = priv;
|
|
|
|
- wpa_printf(MSG_DEBUG, "%s: operstate %d->%d (%s)",
|
|
- __func__, drv->operstate, state, state ? "UP" : "DORMANT");
|
|
- drv->operstate = state;
|
|
- return netlink_send_oper_ifla(drv->netlink, drv->ifindex, -1,
|
|
- state ? IF_OPER_UP : IF_OPER_DORMANT);
|
|
+ if (drv != NULL)
|
|
+ {
|
|
+ wpa_printf(MSG_DEBUG, "%s: operstate %d->%d (%s)",
|
|
+ __func__, drv->operstate, state, state ? "UP" : "DORMANT");
|
|
+ drv->operstate = state;
|
|
+ return netlink_send_oper_ifla(drv->netlink, drv->ifindex, -1,
|
|
+ state ? IF_OPER_UP : IF_OPER_DORMANT);
|
|
+ }
|
|
}
|
|
|
|
|