[PATCH V3 4/7] rnr: move crc32 generation to config load time
Jouni Malinen
j at w1.fi
Tue Dec 1 16:42:21 EST 2020
On Mon, Sep 21, 2020 at 01:50:59PM +0200, John Crispin wrote:
> During config reload the short_ssid was getting flushed. Move the
> generation into the config loading code.
This seems to be missing number of cases where SSID is being set in and
as such, the short_ssid would be unset for those cases. Maybe config
reloading should do this instead of trying to move this to all places
where SSID can be set in bss->ssid.ssid? Alternatively, all the possible
cases would need to be covered, e.g., by introducing a new helper
function for updating the SSID.
> diff --git a/hostapd/config_file.c b/hostapd/config_file.c
> @@ -2355,6 +2356,12 @@ static int hostapd_config_fill(struct hostapd_config *conf,
> os_memcpy(bss->ssid.ssid, pos, bss->ssid.ssid_len);
> bss->ssid.ssid_set = 1;
> +
> + /*
> + * Short SSID calculation is identical to FCS and it is defined in
> + * IEEE P802.11-REVmd/D3.0, 9.4.2.170.3 (Calculating the Short-SSID).
> + */
> + bss->ssid.short_ssid = crc32(bss->ssid.ssid, bss->ssid.ssid_len);
> } else if (os_strcmp(buf, "ssid2") == 0) {
This ssid2 case is missed here. And at least the one in
wpa_supplicant/ap.c is also missed, but there might be other places as
well, i.e., this looks like a change that would make it quite easy to
miss the needed short_ssid calculations.
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list