8ea0e123601a71866b858c8ac61ef80ef66cf28c
[openwrt/svn-archive/archive.git] / package / hostapd / patches / 460-oper_state_fix.patch
1 From: Jouni Malinen <jouni.malinen@atheros.com>
2 Date: Tue, 26 Oct 2010 13:30:28 +0000 (+0300)
3 Subject: hostapd: Set operstate UP when initializing AP mode
4 X-Git-Url: http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=commitdiff_plain;h=e11f5a2cbc333113a3a1cc1aeea7f698c3936ca3
5
6 hostapd: Set operstate UP when initializing AP mode
7
8 This is needed to avoid problems with other applications setting and
9 leaving the interface to IF_OPER_DORMANT state. In AP mode, the interface
10 is ready immediately after the keys are set, so we better make sure the
11 DORMANT state does not prevent normal operations after that.
12 ---
13
14 --- a/src/ap/hostapd.c
15 +++ b/src/ap/hostapd.c
16 @@ -622,6 +622,9 @@ static int hostapd_setup_bss(struct host
17
18 ieee802_11_set_beacon(hapd);
19
20 + if (hapd->driver && hapd->driver->set_operstate)
21 + hapd->driver->set_operstate(hapd->drv_priv, 1);
22 +
23 return 0;
24 }
25
26 --- a/src/drivers/driver_wext.c
27 +++ b/src/drivers/driver_wext.c
28 @@ -2245,11 +2245,14 @@ int wpa_driver_wext_set_operstate(void *
29 {
30 struct wpa_driver_wext_data *drv = priv;
31
32 - wpa_printf(MSG_DEBUG, "%s: operstate %d->%d (%s)",
33 - __func__, drv->operstate, state, state ? "UP" : "DORMANT");
34 - drv->operstate = state;
35 - return netlink_send_oper_ifla(drv->netlink, drv->ifindex, -1,
36 - state ? IF_OPER_UP : IF_OPER_DORMANT);
37 + if (drv != NULL)
38 + {
39 + wpa_printf(MSG_DEBUG, "%s: operstate %d->%d (%s)",
40 + __func__, drv->operstate, state, state ? "UP" : "DORMANT");
41 + drv->operstate = state;
42 + return netlink_send_oper_ifla(drv->netlink, drv->ifindex, -1,
43 + state ? IF_OPER_UP : IF_OPER_DORMANT);
44 + }
45 }
46
47