[PATCH 10/18] bss: Parse and store MLD address of the AP from ML IE

Jouni Malinen j at w1.fi
Wed Aug 31 12:54:03 PDT 2022


On Thu, Jul 28, 2022 at 07:15:39PM +0530, Veerendranath Jakkam wrote:
> Parse ML IE received in scan result to get AP MLD address and cache it
> in wpa_bss structure.

> diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
> @@ -483,11 +492,19 @@ static struct wpa_bss * wpa_bss_add(struct wpa_supplicant *wpa_s,

> +	extra[0] = '\0';
> +	pos = extra;
> +	len = sizeof(extra);
>  	if (!is_zero_ether_addr(bss->hessid))
> -		os_snprintf(extra, sizeof(extra), " HESSID " MACSTR,
> -			    MAC2STR(bss->hessid));
> -	else
> -		extra[0] = '\0';
> +		ret = os_snprintf(pos, extra + len - pos, " HESSID " MACSTR,
> +				  MAC2STR(bss->hessid));
> +
> +	if (!is_zero_ether_addr(bss->mld_addr) &&
> +	    !os_snprintf_error(extra + len - pos, ret))
> +		ret = os_snprintf(pos, extra + len - pos, " MLD ADDR " MACSTR,
> +				  MAC2STR(bss->mld_addr));

Wouldn't this "MLD ADDR" entry override the HESSID entry since the pos
pointer was not updated after the first print?

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list