[PATCH 5/8] mka: pass full structures down to macsec drivers' receive SC ops

Jouni Malinen j at w1.fi
Mon Oct 3 03:20:32 PDT 2016


On Tue, Sep 20, 2016 at 09:43:08AM +0200, Sabrina Dubroca wrote:
> Clean up the driver interface by passing pointers to struct receive_sc
> down the stack to the {create,delete}_recevie_sc ops, instead
> of passing the individual properties of the SC.

This has the same issue with conf_offset enum vs. int:

> diff --git a/src/drivers/driver.h b/src/drivers/driver.h
> -	int (*create_receive_sc)(void *priv, u32 channel, const u8 *sci_addr,
> -				 u16 sci_port, unsigned int conf_offset,
> +	int (*create_receive_sc)(void *priv, struct receive_sc *sc,
> +				 enum confidentiality_offset conf_offset,
>  				 int validation);

> diff --git a/src/drivers/driver_macsec_qca.c b/src/drivers/driver_macsec_qca.c
> -static int macsec_qca_create_receive_sc(void *priv, u32 channel,
> -					const u8 *sci_addr, u16 sci_port,
> +static int macsec_qca_create_receive_sc(void *priv, struct receive_sc *sc,
>  					unsigned int conf_offset,
>  					int validation)

> diff --git a/wpa_supplicant/wpas_kay.c b/wpa_supplicant/wpas_kay.c

> -static int wpas_create_receive_sc(void *wpa_s, u32 channel,
> -				  struct ieee802_1x_mka_sci *sci,
> +static int wpas_create_receive_sc(void *wpa_s, struct receive_sc *sc,
>  				  enum validate_frames vf,
>  				  enum confidentiality_offset co)
>  {
> -	return wpa_drv_create_receive_sc(wpa_s, channel, sci->addr,
> -					 be_to_host16(sci->port),
> -					 conf_offset_val(co), vf);
> +	return wpa_drv_create_receive_sc(wpa_s, sc, conf_offset_val(co), vf);
>  }
 
-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list