diff options
Diffstat (limited to 'package/network/services/hostapd/patches/700-wifi-reload.patch')
-rw-r--r-- | package/network/services/hostapd/patches/700-wifi-reload.patch | 72 |
1 files changed, 23 insertions, 49 deletions
diff --git a/package/network/services/hostapd/patches/700-wifi-reload.patch b/package/network/services/hostapd/patches/700-wifi-reload.patch index 174127df6e..5ac7f711a5 100644 --- a/package/network/services/hostapd/patches/700-wifi-reload.patch +++ b/package/network/services/hostapd/patches/700-wifi-reload.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2416,6 +2416,8 @@ static int hostapd_config_fill(struct ho +@@ -2418,6 +2418,8 @@ static int hostapd_config_fill(struct ho bss->isolate = atoi(pos); } else if (os_strcmp(buf, "ap_max_inactivity") == 0) { bss->ap_max_inactivity = atoi(pos); @@ -8,8 +8,8 @@ + bss->config_id = os_strdup(pos); } else if (os_strcmp(buf, "skip_inactivity_poll") == 0) { bss->skip_inactivity_poll = atoi(pos); - } else if (os_strcmp(buf, "country_code") == 0) { -@@ -3121,6 +3123,8 @@ static int hostapd_config_fill(struct ho + } else if (os_strcmp(buf, "config_id") == 0) { +@@ -3128,6 +3130,8 @@ static int hostapd_config_fill(struct ho } } else if (os_strcmp(buf, "acs_exclude_dfs") == 0) { conf->acs_exclude_dfs = atoi(pos); @@ -20,15 +20,7 @@ } else if (os_strcmp(buf, "channel") == 0) { --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c -@@ -796,6 +796,7 @@ void hostapd_config_free_bss(struct host - os_free(conf->radius_req_attr_sqlite); - os_free(conf->rsn_preauth_interfaces); - os_free(conf->ctrl_interface); -+ os_free(conf->config_id); - os_free(conf->ca_cert); - os_free(conf->server_cert); - os_free(conf->server_cert2); -@@ -995,6 +996,7 @@ void hostapd_config_free(struct hostapd_ +@@ -997,6 +997,7 @@ void hostapd_config_free(struct hostapd_ for (i = 0; i < conf->num_bss; i++) hostapd_config_free_bss(conf->bss[i]); @@ -38,16 +30,7 @@ os_free(conf->basic_rates); --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -285,6 +285,8 @@ struct hostapd_bss_config { - char vlan_bridge[IFNAMSIZ + 1]; - char wds_bridge[IFNAMSIZ + 1]; - -+ char *config_id; -+ - enum hostapd_logger_level logger_syslog_level, logger_stdout_level; - - unsigned int logger_syslog; /* module bitfield */ -@@ -969,6 +971,7 @@ struct eht_phy_capabilities_info { +@@ -987,6 +987,7 @@ struct eht_phy_capabilities_info { struct hostapd_config { struct hostapd_bss_config **bss, *last_bss; size_t num_bss; @@ -57,7 +40,7 @@ int rts_threshold; --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -224,6 +224,10 @@ static int hostapd_iface_conf_changed(st +@@ -254,6 +254,10 @@ static int hostapd_iface_conf_changed(st { size_t i; @@ -68,7 +51,7 @@ if (newconf->num_bss != oldconf->num_bss) return 1; -@@ -237,7 +241,7 @@ static int hostapd_iface_conf_changed(st +@@ -267,7 +271,7 @@ static int hostapd_iface_conf_changed(st } @@ -77,26 +60,17 @@ { struct hapd_interfaces *interfaces = iface->interfaces; struct hostapd_data *hapd = iface->bss[0]; -@@ -260,13 +264,16 @@ int hostapd_reload_config(struct hostapd - if (newconf == NULL) - return -1; - -- hostapd_clear_old(iface); -- - oldconf = hapd->iconf; - if (hostapd_iface_conf_changed(newconf, oldconf)) { +@@ -295,6 +299,9 @@ int hostapd_reload_config(struct hostapd char *fname; int res; + if (reconf) + return -1; + -+ hostapd_clear_old(iface); -+ + hostapd_clear_old(iface); + wpa_printf(MSG_DEBUG, - "Configuration changes include interface/BSS modification - force full disable+enable sequence"); - fname = os_strdup(iface->config_fname); -@@ -291,6 +298,24 @@ int hostapd_reload_config(struct hostapd +@@ -321,6 +328,24 @@ int hostapd_reload_config(struct hostapd wpa_printf(MSG_ERROR, "Failed to enable interface on config reload"); return res; @@ -121,7 +95,7 @@ } iface->conf = newconf; -@@ -307,6 +332,12 @@ int hostapd_reload_config(struct hostapd +@@ -337,6 +362,12 @@ int hostapd_reload_config(struct hostapd for (j = 0; j < iface->num_bss; j++) { hapd = iface->bss[j]; @@ -131,10 +105,10 @@ + } + if (newconf->bss[j]->config_id) + hapd->config_id = strdup(newconf->bss[j]->config_id); - hapd->iconf = newconf; - hapd->conf = newconf->bss[j]; - hostapd_reload_bss(hapd); -@@ -2420,6 +2451,10 @@ hostapd_alloc_bss_data(struct hostapd_if + if (!hapd->conf->config_id || !newconf->bss[j]->config_id || + os_strcmp(hapd->conf->config_id, + newconf->bss[j]->config_id) != 0) +@@ -2514,6 +2545,10 @@ hostapd_alloc_bss_data(struct hostapd_if hapd->iconf = conf; hapd->conf = bss; hapd->iface = hapd_iface; @@ -164,7 +138,7 @@ int interface_added; /* virtual interface added for this BSS */ unsigned int started:1; unsigned int disabled:1; -@@ -667,7 +668,7 @@ struct hostapd_iface { +@@ -676,7 +677,7 @@ struct hostapd_iface { int hostapd_for_each_interface(struct hapd_interfaces *interfaces, int (*cb)(struct hostapd_iface *iface, void *ctx), void *ctx); @@ -175,19 +149,19 @@ hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface, --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4852,6 +4852,9 @@ static int wpa_driver_nl80211_set_ap(voi +@@ -5054,6 +5054,9 @@ static int wpa_driver_nl80211_set_ap(voi if (ret) { wpa_printf(MSG_DEBUG, "nl80211: Beacon set failed: %d (%s)", ret, strerror(-ret)); -+ if (!bss->beacon_set) ++ if (!bss->flink->beacon_set) + ret = 0; -+ bss->beacon_set = 0; ++ bss->flink->beacon_set = 0; } else { - bss->beacon_set = 1; + bss->flink->beacon_set = 1; nl80211_set_bss(bss, params->cts_protect, params->preamble, --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -186,7 +186,7 @@ static int hostapd_ctrl_iface_update(str +@@ -187,7 +187,7 @@ static int hostapd_ctrl_iface_update(str iface->interfaces->config_read_cb = hostapd_ctrl_iface_config_read; reload_opts = txt; @@ -198,7 +172,7 @@ } --- a/hostapd/main.c +++ b/hostapd/main.c -@@ -317,7 +317,7 @@ static void handle_term(int sig, void *s +@@ -320,7 +320,7 @@ static void handle_term(int sig, void *s static int handle_reload_iface(struct hostapd_iface *iface, void *ctx) { |