[PATCHv2 05/21] Remove WPA per-VLAN groups when all stations left on rekeying

Jouni Malinen j
Tue Jun 25 02:10:49 PDT 2013


On Fri, May 17, 2013 at 01:23:02AM +0200, Michael Braun wrote:
> This adds a references counter to struct wpa_group and frees
> a group if it is unused during rekeying.
> 
> This is useful when extending the number of VLANs supported.

> diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
> @@ -234,15 +242,26 @@ static void wpa_rekey_gmk(void *eloop_ctx, void *timeout_ctx)
>  static void wpa_rekey_gtk(void *eloop_ctx, void *timeout_ctx)

> +		if (group->references == 0 && prev) {
> +			/* this does never delete the special first group */
> +			prev->next = group->next;
> +			wpa_group_free(group);
> +			group = prev->next;

Why would this be in wpa_rekey_gtk() instead of wpa_free_sta_sm() and
wpa_auth_sta_set_vlan() that are the only places where the references
counter is decremented?

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list