Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 38914master
parent
48de8ed52a
commit
1d75f7506d
@ -1,101 +0,0 @@ |
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -754,7 +754,6 @@ nla_put_failure:
|
||||
}
|
||||
|
||||
|
||||
-#ifndef HOSTAPD
|
||||
static int nl80211_get_macaddr(struct i802_bss *bss)
|
||||
{
|
||||
struct nl_msg *msg;
|
||||
@@ -776,7 +775,6 @@ nla_put_failure:
|
||||
nlmsg_free(msg);
|
||||
return NL80211_IFTYPE_UNSPECIFIED;
|
||||
}
|
||||
-#endif /* HOSTAPD */
|
||||
|
||||
|
||||
static int nl80211_register_beacons(struct wpa_driver_nl80211_data *drv,
|
||||
@@ -3613,6 +3611,7 @@ static void * wpa_driver_nl80211_init(vo
|
||||
drv->monitor_sock = -1;
|
||||
drv->eapol_tx_sock = -1;
|
||||
drv->ap_scan_as_station = NL80211_IFTYPE_UNSPECIFIED;
|
||||
+ drv->nlmode = NL80211_IFTYPE_STATION;
|
||||
|
||||
if (wpa_driver_nl80211_init_nl(drv)) {
|
||||
os_free(drv);
|
||||
@@ -4003,31 +4002,16 @@ static int i802_set_iface_flags(struct i
|
||||
|
||||
|
||||
static int
|
||||
-wpa_driver_nl80211_finish_drv_init(struct wpa_driver_nl80211_data *drv)
|
||||
+wpa_driver_nl80211_finish_drv_init_sta(struct wpa_driver_nl80211_data *drv,
|
||||
+ int *send_rfkill_event)
|
||||
{
|
||||
-#ifndef HOSTAPD
|
||||
enum nl80211_iftype nlmode = NL80211_IFTYPE_STATION;
|
||||
-#endif /* HOSTAPD */
|
||||
struct i802_bss *bss = &drv->first_bss;
|
||||
- int send_rfkill_event = 0;
|
||||
int dynamic_if;
|
||||
|
||||
- drv->ifindex = if_nametoindex(bss->ifname);
|
||||
- bss->ifindex = drv->ifindex;
|
||||
- bss->wdev_id = drv->global->if_add_wdevid;
|
||||
- bss->wdev_id_set = drv->global->if_add_wdevid_set;
|
||||
-
|
||||
dynamic_if = drv->ifindex == drv->global->if_add_ifindex;
|
||||
dynamic_if = dynamic_if || drv->global->if_add_wdevid_set;
|
||||
- drv->global->if_add_wdevid_set = 0;
|
||||
|
||||
- if (wpa_driver_nl80211_capa(drv))
|
||||
- return -1;
|
||||
-
|
||||
- wpa_printf(MSG_DEBUG, "nl80211: interface %s in phy %s",
|
||||
- bss->ifname, drv->phyname);
|
||||
-
|
||||
-#ifndef HOSTAPD
|
||||
if (dynamic_if)
|
||||
nlmode = nl80211_get_ifmode(bss);
|
||||
|
||||
@@ -4056,7 +4040,7 @@ wpa_driver_nl80211_finish_drv_init(struc
|
||||
"interface '%s' due to rfkill",
|
||||
bss->ifname);
|
||||
drv->if_disabled = 1;
|
||||
- send_rfkill_event = 1;
|
||||
+ *send_rfkill_event = 1;
|
||||
} else {
|
||||
wpa_printf(MSG_ERROR, "nl80211: Could not set "
|
||||
"interface '%s' UP", bss->ifname);
|
||||
@@ -4066,7 +4050,30 @@ wpa_driver_nl80211_finish_drv_init(struc
|
||||
|
||||
netlink_send_oper_ifla(drv->global->netlink, drv->ifindex,
|
||||
1, IF_OPER_DORMANT);
|
||||
-#endif /* HOSTAPD */
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+wpa_driver_nl80211_finish_drv_init(struct wpa_driver_nl80211_data *drv)
|
||||
+{
|
||||
+ struct i802_bss *bss = &drv->first_bss;
|
||||
+ int send_rfkill_event = 0;
|
||||
+
|
||||
+ drv->ifindex = if_nametoindex(bss->ifname);
|
||||
+ bss->ifindex = drv->ifindex;
|
||||
+ bss->wdev_id = drv->global->if_add_wdevid;
|
||||
+ bss->wdev_id_set = drv->global->if_add_wdevid_set;
|
||||
+ drv->global->if_add_wdevid_set = 0;
|
||||
+
|
||||
+ if (wpa_driver_nl80211_capa(drv))
|
||||
+ return -1;
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "nl80211: interface %s in phy %s",
|
||||
+ bss->ifname, drv->phyname);
|
||||
+
|
||||
+ if (drv->nlmode == NL80211_IFTYPE_STATION &&
|
||||
+ wpa_driver_nl80211_finish_drv_init_sta(drv, &send_rfkill_event))
|
||||
+ return -1;
|
||||
|
||||
if (linux_get_ifhwaddr(drv->global->ioctl_sock, bss->ifname,
|
||||
bss->addr))
|
@ -1,45 +0,0 @@ |
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -1095,6 +1095,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,
|
||||
@@ -1202,6 +1206,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) {
|
||||
@@ -3613,6 +3621,11 @@ static void * wpa_driver_nl80211_init(vo
|
||||
drv->ap_scan_as_station = NL80211_IFTYPE_UNSPECIFIED;
|
||||
drv->nlmode = NL80211_IFTYPE_STATION;
|
||||
|
||||
+#ifdef HOSTAPD
|
||||
+ drv->num_if_indices = sizeof(drv->default_if_indices) / sizeof(int);
|
||||
+ drv->if_indices = drv->default_if_indices;
|
||||
+#endif
|
||||
+
|
||||
if (wpa_driver_nl80211_init_nl(drv)) {
|
||||
os_free(drv);
|
||||
return NULL;
|
||||
@@ -8845,8 +8858,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]);
|
@ -1,6 +1,6 @@ |
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -2457,7 +2457,7 @@ static struct wpa_supplicant * wpa_suppl
|
||||
@@ -2488,7 +2488,7 @@ static struct wpa_supplicant * wpa_suppl
|
||||
if (wpa_s == NULL)
|
||||
return NULL;
|
||||
wpa_s->scan_req = INITIAL_SCAN_REQ;
|
@ -0,0 +1,20 @@ |
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -6860,7 +6860,7 @@ static int wpa_driver_nl80211_set_freq(s
|
||||
|
||||
nl80211_cmd(drv, msg, 0, NL80211_CMD_SET_WIPHY);
|
||||
|
||||
- NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex);
|
||||
+ NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, bss->ifindex);
|
||||
if (nl80211_put_freq_params(msg, freq) < 0)
|
||||
goto nla_put_failure;
|
||||
|
||||
@@ -11322,7 +11322,7 @@ static int nl80211_switch_channel(void *
|
||||
return -ENOMEM;
|
||||
|
||||
nl80211_cmd(drv, msg, 0, NL80211_CMD_CHANNEL_SWITCH);
|
||||
- NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex);
|
||||
+ NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, bss->ifindex);
|
||||
NLA_PUT_U32(msg, NL80211_ATTR_CH_SWITCH_COUNT, settings->cs_count);
|
||||
ret = nl80211_put_freq_params(msg, &settings->freq_params);
|
||||
if (ret)
|
@ -0,0 +1,19 @@ |
||||
--- a/src/ap/hostapd.c
|
||||
+++ b/src/ap/hostapd.c
|
||||
@@ -72,6 +72,16 @@ static void hostapd_reload_bss(struct ho
|
||||
#endif /* CONFIG_NO_RADIUS */
|
||||
|
||||
ssid = &hapd->conf->ssid;
|
||||
+
|
||||
+ hostapd_set_freq(hapd, hapd->iconf->hw_mode, hapd->iface->freq,
|
||||
+ hapd->iconf->channel,
|
||||
+ hapd->iconf->ieee80211n,
|
||||
+ hapd->iconf->ieee80211ac,
|
||||
+ hapd->iconf->secondary_channel,
|
||||
+ hapd->iconf->vht_oper_chwidth,
|
||||
+ hapd->iconf->vht_oper_centr_freq_seg0_idx,
|
||||
+ hapd->iconf->vht_oper_centr_freq_seg1_idx);
|
||||
+
|
||||
if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next &&
|
||||
ssid->wpa_passphrase_set && ssid->wpa_passphrase) {
|
||||
/*
|
@ -1,12 +0,0 @@ |
||||
--- a/src/tls/x509v3.c
|
||||
+++ b/src/tls/x509v3.c
|
||||
@@ -1847,6 +1847,9 @@ int x509_certificate_chain_validate(stru
|
||||
if (chain_trusted)
|
||||
continue;
|
||||
|
||||
+#ifdef NO_TIMESTAMP_CHECK
|
||||
+ disable_time_checks = 1;
|
||||
+#endif
|
||||
if (!disable_time_checks &&
|
||||
((unsigned long) now.sec <
|
||||
(unsigned long) cert->not_before ||
|
@ -1,85 +0,0 @@ |
||||
--- a/src/ap/hostapd.c
|
||||
+++ b/src/ap/hostapd.c
|
||||
@@ -133,38 +133,51 @@ static void hostapd_clear_old(struct hos
|
||||
int hostapd_reload_config(struct hostapd_iface *iface)
|
||||
{
|
||||
struct hostapd_data *hapd = iface->bss[0];
|
||||
- struct hostapd_config *newconf, *oldconf;
|
||||
+ struct hostapd_config *conf = hapd->iconf, *oldconf = NULL;
|
||||
size_t j;
|
||||
|
||||
- if (iface->config_fname == NULL) {
|
||||
- /* Only in-memory config in use - assume it has been updated */
|
||||
+ if (iface->config_fname) {
|
||||
+ if (iface->interfaces == NULL ||
|
||||
+ iface->interfaces->config_read_cb == NULL)
|
||||
+ return -1;
|
||||
+ conf = iface->interfaces->config_read_cb(iface->config_fname);
|
||||
+ if (conf == NULL)
|
||||
+ return -1;
|
||||
+
|
||||
hostapd_clear_old(iface);
|
||||
- for (j = 0; j < iface->num_bss; j++)
|
||||
- hostapd_reload_bss(iface->bss[j]);
|
||||
- return 0;
|
||||
- }
|
||||
|
||||
- if (iface->interfaces == NULL ||
|
||||
- iface->interfaces->config_read_cb == NULL)
|
||||
- return -1;
|
||||
- newconf = iface->interfaces->config_read_cb(iface->config_fname);
|
||||
- if (newconf == NULL)
|
||||
- return -1;
|
||||
+ oldconf = hapd->iconf;
|
||||
+ iface->conf = conf;
|
||||
+ }
|
||||
|
||||
- hostapd_clear_old(iface);
|
||||
+ hostapd_select_hw_mode(iface);
|
||||
+ iface->freq = hostapd_hw_get_freq(hapd, conf->channel);
|
||||
|
||||
- oldconf = hapd->iconf;
|
||||
- iface->conf = newconf;
|
||||
+ if (iface->current_mode)
|
||||
+ hostapd_prepare_rates(iface, iface->current_mode);
|
||||
|
||||
for (j = 0; j < iface->num_bss; j++) {
|
||||
hapd = iface->bss[j];
|
||||
- hapd->iconf = newconf;
|
||||
- hapd->conf = &newconf->bss[j];
|
||||
+ hapd->iconf = iface->conf;
|
||||
+ hapd->conf = &iface->conf->bss[j];
|
||||
+
|
||||
+ if (hostapd_set_freq(hapd, conf->hw_mode, iface->freq,
|
||||
+ conf->channel,
|
||||
+ conf->ieee80211n,
|
||||
+ conf->ieee80211ac,
|
||||
+ conf->secondary_channel,
|
||||
+ conf->vht_oper_chwidth,
|
||||
+ conf->vht_oper_centr_freq_seg0_idx,
|
||||
+ conf->vht_oper_centr_freq_seg1_idx)) {
|
||||
+ wpa_printf(MSG_ERROR, "Could not set channel for "
|
||||
+ "kernel driver");
|
||||
+ }
|
||||
+
|
||||
hostapd_reload_bss(hapd);
|
||||
}
|
||||
|
||||
- hostapd_config_free(oldconf);
|
||||
-
|
||||
+ if (oldconf)
|
||||
+ hostapd_config_free(oldconf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -6511,7 +6511,7 @@ static int wpa_driver_nl80211_set_freq(s
|
||||
|
||||
nl80211_cmd(drv, msg, 0, NL80211_CMD_SET_WIPHY);
|
||||
|
||||
- NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex);
|
||||
+ NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, bss->ifindex);
|
||||
NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, freq->freq);
|
||||
if (freq->vht_enabled) {
|
||||
switch (freq->bandwidth) {
|
@ -1,6 +1,6 @@ |
||||
--- a/src/ap/beacon.c
|
||||
+++ b/src/ap/beacon.c
|
||||
@@ -455,6 +455,10 @@ void handle_probe_req(struct hostapd_dat
|
||||
@@ -501,6 +501,10 @@ void handle_probe_req(struct hostapd_dat
|
||||
return;
|
||||
}
|
||||
|
@ -1,11 +0,0 @@ |
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -121,7 +121,7 @@ static struct nl_handle * nl_create_hand
|
||||
}
|
||||
|
||||
if (genl_connect(handle)) {
|
||||
- wpa_printf(MSG_ERROR, "nl80211: Failed to connect to generic "
|
||||
+ wpa_printf(MSG_DEBUG, "nl80211: Failed to connect to generic "
|
||||
"netlink (%s)", dbg);
|
||||
nl80211_handle_destroy(handle);
|
||||
return NULL;
|
Loading…
Reference in new issue