[PATCH] driver_bsd.c: Clean up EAPOL frame transmission code

Jouni Malinen j
Sat Jan 16 01:52:36 PST 2010

On Wed, Jan 13, 2010 at 01:42:36PM +0900, Masashi Honma wrote:

> The bsd_send_eapol() prepares 3000 bytes buffer for every EAPOL
> frame transmission. I think malloc() is better way for efficient
> memory use.

Thanks! Applied.

However, unless I missed something, it would be even better to just get
rid of all the Ethernet header processing in driver_bsd.c and use
l2_packet without asking the header to be included (i.e., changing the
last argument to l2_packet_init to 0). The current version seems to be
requesting l2_packet to include the Ethernet header and then remove this
in driver_bsd on receive add add it for transmit both of which can
already be done in l2_packet_freebsd.c and as such, could be removed
from driver_bsd.c.

Even better solution would be to support data vector in transmit (inside
l2_packet_send) to avoid the extra allocation. However, I do not know
whether this can be done with pcap.

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list