[PATCH] wpa_supplicant: support IBSS RSN STA authorization

Jouni Malinen j at w1.fi
Sun Jan 22 10:30:20 EST 2012


On Tue, Jan 17, 2012 at 03:03:02PM +0100, Antonio Quartulli wrote:
> In IBSS RSN cfg80211/mac80211 now waits for userspace to authorize new stations.
> This patch makes wpa_supplicant notify the driver when a station can be
> considered authorised.

> diff --git a/wpa_supplicant/ibss_rsn.c b/wpa_supplicant/ibss_rsn.c
> @@ -19,6 +19,7 @@
>  #include "ap/wpa_auth.h"
> +#include "ap/wpa_auth_i.h"

This is not acceptable - the internal header files (*_i.h) are not
supposed to be included outside the directory in which they are defined.

> @@ -545,7 +546,7 @@ static int ibss_rsn_process_rx_eapol(struct ibss_rsn *ibss_rsn,
> +		/* check if the peer has been authorized */
> +		if (peer->auth->wpa_ptk_state == WPA_PTK_PTKINITDONE) {

This is looking at an internal state in a way that makes it more
difficult to maintain the code in the future. A cleaner design is going
to be needed here, e.g., with a callback function. Wouldn't the way used
in AP code be suitable for this? See how hostapd_wpa_auth_set_eapol() is
used to handle WPA_EAPOL_authorized changes in src/ap/wpa_auth_glue.c
for an example. wpa_supplicant/ibss_rsn.c should be able to do the same.

-- 
Jouni Malinen                                            PGP id EFC895FA


More information about the HostAP mailing list