hostapd: fix wpa_supplicant crash issues in WDS STA mode

SVN-Revision: 23067
This commit is contained in:
Felix Fietkau 2010-09-15 03:14:48 +00:00
parent 7557011cb1
commit 7fb3870671

View file

@ -0,0 +1,43 @@
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -410,6 +410,10 @@ static void wpa_driver_nl80211_event_rtm
return;
}
+ if (ifi->ifi_family == AF_BRIDGE &&
+ drv->nlmode != NL80211_IFTYPE_AP)
+ return;
+
wpa_printf(MSG_DEBUG, "RTM_NEWLINK: operstate=%d ifi_flags=0x%x "
"(%s%s%s%s)",
drv->operstate, ifi->ifi_flags,
@@ -481,6 +485,10 @@ static void wpa_driver_nl80211_event_rtm
attrlen = len;
attr = (struct rtattr *) buf;
+ if (ifi->ifi_family == AF_BRIDGE &&
+ drv->nlmode != NL80211_IFTYPE_AP)
+ return;
+
rta_len = RTA_ALIGN(sizeof(struct rtattr));
while (RTA_OK(attr, attrlen)) {
if (attr->rta_type == IFLA_IFNAME) {
@@ -1347,6 +1355,9 @@ static int wpa_driver_nl80211_init_nl(st
eloop_register_read_sock(nl_socket_get_fd(drv->nl_handle_event),
wpa_driver_nl80211_event_receive, drv, ctx);
+ drv->num_if_indices = sizeof(drv->default_if_indices) / sizeof(int);
+ drv->if_indices = drv->default_if_indices;
+
return 0;
err4:
@@ -4867,8 +4878,6 @@ static void *i802_init(struct hostapd_da
br_ifindex = 0;
}
- drv->num_if_indices = sizeof(drv->default_if_indices) / sizeof(int);
- drv->if_indices = drv->default_if_indices;
for (i = 0; i < params->num_bridge; i++) {
if (params->bridge[i]) {
ifindex = if_nametoindex(params->bridge[i]);