Re: [PATCH 7/7] Hostapd: Add support for eapol tx/rx handling with vendor cmd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 26, 2018 at 03:10:26PM +0530, Sarada Prasanna Garnayak wrote:
> Implement sending and receiving eapol frames via nl80211 vendor
> command.

Like I noted for an earlier patch, I'd much rather see this use upstream
nl80211 command/event.

> diff --git a/src/drivers/driver.h b/src/drivers/driver.h
> @@ -2730,6 +2730,19 @@ struct wpa_driver_ops {
>  	int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data,
>  			       size_t data_len, int encrypt,
>  			       const u8 *own_addr, u32 flags);
> +	/**
> +	 * vendor_send_eapol_data - Vendor send an EAPOL packet (AP only)
> +	 * @priv: private driver interface data
> +	 * @addr: Destination MAC address
> +	 * @data: EAPOL packet starting with IEEE 802.1X header
> +	 * @data_len: Length of the EAPOL packet in octets
> +	 * @own_addr: Source MAC address
> +	 *
> +	 * Returns: 0 on success, -1 on failure
> +	 */
> +	int (*vendor_send_eapol_data)(void *priv, const u8 *addr,
> +				      const u8 *own_addr, const u8 *data,
> +				      size_t data_len);

And I don't think we should be adding yet another send-eapol
wpa_driver_ops function. Instead, that hapd_send_eapol() should be made
more generic to cover the additional needs.

In fact, this vendor_send_eapol_data() is not actually used at all
outside src/drivers in this patch.. It is only misused within
wpa_driver_nl80211_hapd_send_eapol() by dereferencing hapd->driver
(src/drivers/* must not dereference hapd).. Instead of that,
driver_nl80211.c should just call nl80211_vendor_send_eapol_data()
directly and this addition of vendor_send_eapol_data drivers_ops shoudl
be removed. nl80211_vendor_send_eapol_data() itself would need to be
moved into src/drivers/*.c file, though, as noted in an earlier email.

> diff --git a/wpa_supplicant/wpas_glue.c b/wpa_supplicant/wpas_glue.c
> @@ -112,6 +112,11 @@ static int wpa_ether_send(struct wpa_supplicant *wpa_s, const u8 *dest,

> +#ifdef CONFIG_DRIVER_NL80211_INTEL_LTQ
> +	return wpa_drv_hapd_send_eapol(wpa_s, dest, buf, len,
> +				       0, wpa_s->own_addr, 0);
> +#endif /* CONFIG_DRIVER_NL80211_INTEL_LTQ */
> +
>  	if (wpa_s->l2) {
>  		return l2_packet_send(wpa_s->l2, dest, proto, buf, len);
>  	}

Could you please clarify how this wpa_supplicant change is supposed to
work and how it would be using a function documented with "AP only"?
Please also note that this CONFIG_DRIVER_NL80211_INTEL_LTQ ifdef here
does not look appropriate for core wpa_supplicant code; it should be
independent of the driver interface. Furthermore, this cannot really be
correct functionality since it would make that l2_packet_send() case
unreachable code and that would break wpa_supplicant builds with
CONFIG_DRIVER_NL80211_INTEL_LTQ defined for all drivers that do not
support the hapd_send_eapol() functionality in STA mode.
 
-- 
Jouni Malinen                                            PGP id EFC895FA

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux