[PATCH v2 3/4] mka: remove "channel" hacks from the stack and the macsec_qca driver

Jouni Malinen j at w1.fi
Sun Oct 9 01:26:28 PDT 2016


On Fri, Oct 07, 2016 at 12:08:11PM +0200, Sabrina Dubroca wrote:
> diff --git a/src/drivers/driver_macsec_qca.c b/src/drivers/driver_macsec_qca.c
> +static int macsec_qca_lookup_channel(struct channel_map *map,
> +				     struct ieee802_1x_mka_sci *sci,
> +				     u32 *channel)
> +{
> +	int i;
> +
> +	for (i = 0; i < MAXSC; i++) {
> +		if (os_memcmp(&map[i].sci, sci,
> +			      sizeof(struct ieee802_1x_mka_sci))) {
> +			*channel = i;
> +			return 0;
> +		}

Is this condition really supposed to select the first mismatching sci?
Or was that supposed to be os_memcmp(...) == 0 instead to find a match?

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list