mirror of
				https://github.com/Telecominfraproject/wlan-ap.git
				synced 2025-10-31 10:28:06 +00:00 
			
		
		
		
	hostapd: fix OWE vendor IE content
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
		| @@ -88,6 +88,14 @@ | |||||||
|  void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, |  void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, | ||||||
|  			   int reassoc); |  			   int reassoc); | ||||||
|  void hostapd_interface_deinit_free(struct hostapd_iface *iface); |  void hostapd_interface_deinit_free(struct hostapd_iface *iface); | ||||||
|  | @@ -662,6 +671,7 @@ hostapd_switch_channel_fallback(struct h | ||||||
|  |  void hostapd_cleanup_cs_params(struct hostapd_data *hapd); | ||||||
|  |  void hostapd_periodic_iface(struct hostapd_iface *iface); | ||||||
|  |  int hostapd_owe_trans_get_info(struct hostapd_data *hapd); | ||||||
|  | +void hostapd_owe_update_trans(struct hostapd_iface *iface); | ||||||
|  |  void hostapd_ocv_check_csa_sa_query(void *eloop_ctx, void *timeout_ctx); | ||||||
|  |   | ||||||
|  |  /* utils.c */ | ||||||
| --- a/src/ap/hostapd.c | --- a/src/ap/hostapd.c | ||||||
| +++ b/src/ap/hostapd.c | +++ b/src/ap/hostapd.c | ||||||
| @@ -216,6 +216,8 @@ int hostapd_reload_config(struct hostapd | @@ -216,6 +216,8 @@ int hostapd_reload_config(struct hostapd | ||||||
| @@ -132,6 +140,15 @@ | |||||||
|   |   | ||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
|  | @@ -1945,7 +1950,7 @@ static int hostapd_owe_iface_iter2(struc | ||||||
|  |  #endif /* CONFIG_OWE */ | ||||||
|  |   | ||||||
|  |   | ||||||
|  | -static void hostapd_owe_update_trans(struct hostapd_iface *iface) | ||||||
|  | +void hostapd_owe_update_trans(struct hostapd_iface *iface) | ||||||
|  |  { | ||||||
|  |  #ifdef CONFIG_OWE | ||||||
|  |  	/* Check whether the enabled BSS can complete OWE transition mode | ||||||
| @@ -2090,7 +2095,7 @@ static int hostapd_setup_interface_compl | @@ -2090,7 +2095,7 @@ static int hostapd_setup_interface_compl | ||||||
|  		hapd = iface->bss[j]; |  		hapd = iface->bss[j]; | ||||||
|  		if (j) |  		if (j) | ||||||
| @@ -568,3 +585,37 @@ | |||||||
|  	.send_mlme = driver_nl80211_send_mlme, |  	.send_mlme = driver_nl80211_send_mlme, | ||||||
|  	.get_hw_feature_data = nl80211_get_hw_feature_data, |  	.get_hw_feature_data = nl80211_get_hw_feature_data, | ||||||
|  	.sta_add = wpa_driver_nl80211_sta_add, |  	.sta_add = wpa_driver_nl80211_sta_add, | ||||||
|  | --- a/src/ap/ucode.c | ||||||
|  | +++ b/src/ap/ucode.c | ||||||
|  | @@ -255,6 +255,7 @@ uc_hostapd_bss_set_config(uc_vm_t *vm, s | ||||||
|  |   | ||||||
|  |  	hostapd_setup_bss(hapd, hapd == iface->bss[0], true); | ||||||
|  |  	hostapd_ucode_update_interfaces(); | ||||||
|  | +	hostapd_owe_update_trans(iface); | ||||||
|  |   | ||||||
|  |  done: | ||||||
|  |  	ret = 0; | ||||||
|  | @@ -375,6 +376,7 @@ uc_hostapd_iface_add_bss(uc_vm_t *vm, si | ||||||
|  |  	conf->bss[idx] = NULL; | ||||||
|  |  	ret = hostapd_ucode_bss_get_uval(hapd); | ||||||
|  |  	hostapd_ucode_update_interfaces(); | ||||||
|  | +	hostapd_owe_update_trans(iface); | ||||||
|  |  	goto out; | ||||||
|  |   | ||||||
|  |  deinit_ctrl: | ||||||
|  | @@ -602,6 +604,7 @@ out: | ||||||
|  |   | ||||||
|  |  		ieee802_11_set_beacon(hapd); | ||||||
|  |  	} | ||||||
|  | +	hostapd_owe_update_trans(iface); | ||||||
|  |   | ||||||
|  |  	return ucv_boolean_new(true); | ||||||
|  |  } | ||||||
|  | @@ -693,6 +696,7 @@ uc_hostapd_bss_rename(uc_vm_t *vm, size_ | ||||||
|  |  	hostapd_ubus_add_bss(hapd); | ||||||
|  |   | ||||||
|  |  	hostapd_ucode_update_interfaces(); | ||||||
|  | +	hostapd_owe_update_trans(hapd->iface); | ||||||
|  |  out: | ||||||
|  |  	if (interfaces->ctrl_iface_init) | ||||||
|  |  		interfaces->ctrl_iface_init(hapd); | ||||||
|   | |||||||
| @@ -0,0 +1,27 @@ | |||||||
|  | --- a/src/ap/hostapd.c | ||||||
|  | +++ b/src/ap/hostapd.c | ||||||
|  | @@ -1995,6 +1995,13 @@ static int hostapd_owe_iface_iter(struct | ||||||
|  |  		    is_zero_ether_addr(bss->own_addr)) | ||||||
|  |  			continue; | ||||||
|  |   | ||||||
|  | +		if (!os_memcmp(hapd->conf->owe_transition_bssid, bss->own_addr, | ||||||
|  | +			       ETH_ALEN) && | ||||||
|  | +		    hapd->conf->owe_transition_ssid_len == bss->conf->ssid.ssid_len && | ||||||
|  | +		    !os_memcmp(hapd->conf->owe_transition_ssid, bss->conf->ssid.ssid, | ||||||
|  | +			       bss->conf->ssid.ssid_len)) | ||||||
|  | +			return 0; | ||||||
|  | + | ||||||
|  |  		os_memcpy(hapd->conf->owe_transition_bssid, bss->own_addr, | ||||||
|  |  			  ETH_ALEN); | ||||||
|  |  		os_memcpy(hapd->conf->owe_transition_ssid, | ||||||
|  | @@ -2011,10 +2018,6 @@ static int hostapd_owe_iface_iter(struct | ||||||
|  |   | ||||||
|  |  int hostapd_owe_trans_get_info(struct hostapd_data *hapd) | ||||||
|  |  { | ||||||
|  | -	if (hapd->conf->owe_transition_ssid_len > 0 && | ||||||
|  | -	    !is_zero_ether_addr(hapd->conf->owe_transition_bssid)) | ||||||
|  | -		return 0; | ||||||
|  | - | ||||||
|  |  	/* Find transition mode SSID/BSSID information from a BSS operated by | ||||||
|  |  	 * this hostapd instance. */ | ||||||
|  |  	if (!hapd->iface->interfaces || | ||||||
		Reference in New Issue
	
	Block a user
	 John Crispin
					John Crispin