[PATCH] add new macsec offload modes to abstract device-level details

Beniamino Galvani bgalvani at redhat.com
Thu Feb 8 13:09:47 PST 2024


On Tue, Feb 06, 2024 at 03:15:03PM +0100, Sabrina Dubroca wrote:
> Currently, users have to guess which offload mode their hardware
> provides, as the kernel doesn't expose this information.
> 
> Add an "on" mode which requires offload (either to mac or phy) and a
> "prefer" mode which allows fallback to SW when offload (either to mac
> or phy) is unavailable.
> 
> Also rename the existing modes to string values to make the config
> file a bit clearer.
> 
> Signed-off-by: Sabrina Dubroca <sd at queasysnail.net>
> ---
> [...]
>  static int hostapd_config_fill(struct hostapd_config *conf,
>  			       struct hostapd_bss_config *bss,
> @@ -4816,15 +4839,12 @@ static int hostapd_config_fill(struct hostapd_config *conf,
>  	} else if (os_strcmp(buf, "macsec_replay_window") == 0) {
>  		bss->macsec_replay_window = atoi(pos);
>  	} else if (os_strcmp(buf, "macsec_offload") == 0) {
> -		int macsec_offload = atoi(pos);
> -
> -		if (macsec_offload < 0 || macsec_offload > 2) {
> +		if (parse_macsec_offload(bss, pos)) {
>  			wpa_printf(MSG_ERROR,
> -				   "Line %d: invalid macsec_offload (%d): '%s'.",
> -				   line, macsec_offload, pos);
> +				   "Line %d: invalid macsec_offload: '%s'.",


Hi,

the "macsec_offload" property now needs to be added to the
"dont_quote" array in dbus_new_handlers.c, otherwise the string value
received from D-Bus gets enclosed in double quotes and is rejected as
invalid:

  ..
  wpa_dbus_dict_open_read: start reading a dict entry
  wpa_dbus_dict_get_entry: dict entry key: macsec_offload
  wpa_dbus_dict_get_entry: dict entry variant content type: s
  _wpa_dbus_dict_fill_value_from_variant: string value: mac
  Line 0: Invalid macsec_offload: '"mac"'.

Beniamino
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/hostap/attachments/20240208/fd94ef48/attachment.sig>


More information about the Hostap mailing list