[PATCH 2/2] Add timeout option in hostapd.conf for eap_sim_db

Jouni Malinen j
Fri Sep 25 09:59:20 PDT 2015


On Mon, Sep 21, 2015 at 11:30:15AM +0200, Frederic Leroy wrote:
> Makes eap_sim_db timeout configurable.

I'd rather move this patch 2/2 to be the first once to go in..

Please also update hostapd/hostapd.conf to describe the new
configuration parameter.

> diff --git a/src/eap_server/eap_sim_db.c b/src/eap_server/eap_sim_db.c
> @@ -859,7 +861,7 @@ static void eap_sim_db_expire_pending(struct eap_sim_db_data *data, struct eap_s
>  	/* TODO: add limit for maximum length for pending list; remove latest
>  	 * (i.e., last) entry from the list if the limit is reached; could also
>  	 * use timeout to expire pending entries */
> -	eloop_register_timeout(EAP_SIM_DB_QUERY_TIMEOUT_SEC, EAP_SIM_DB_QUERY_TIMEOUT_USEC, eap_sim_db_query_timeout, entry, data);
> +	eloop_register_timeout(data->eap_sim_db_timeout, 0, eap_sim_db_query_timeout, entry, data);
>  }

And include this in the current patch 1/2, so that there is no need to
add the temporary EAP_SIM_DB_QUERY_TIMEOUT* defines that get removed
here:

> diff --git a/src/eap_server/eap_sim_db.h b/src/eap_server/eap_sim_db.h
> @@ -45,9 +45,6 @@ int eap_sim_db_get_gsm_triplets(struct eap_sim_db_data *data,
>  #define EAP_SIM_DB_FAILURE -1
>  #define EAP_SIM_DB_PENDING -2
>  
> -#define EAP_SIM_DB_QUERY_TIMEOUT_SEC 1
> -#define EAP_SIM_DB_QUERY_TIMEOUT_USEC 0
> -
>  char * eap_sim_db_get_next_pseudonym(struct eap_sim_db_data *data,
>  				     enum eap_sim_db_method method);
 
-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list