BUG in wpa_supplicant from GIT HEAD

Pavel Roskin proski
Mon Mar 15 22:36:11 PDT 2010


On Mon, 2010-03-15 at 15:00 +0100, Holger Schurig wrote:
> Is there a specific reason that calls to driver-functions use "void *"?

It's used where driver specific data is passed.  Any more specific
pointer would require casts, which could hide worse errors.

One possible way to harden the code would be to pass ctx and let the
drivers find the private data using container_of().  Since ctx is a void
pointer itself, it should be changed to a pointer to a structure pointer
to avoid similar mistakes.

The required changes will affect all drivers and could introduce
instability.

For a large project with many contributors, such hardening would pay off
in the long term, but I'm not sure about hostapd/wpa_supplicant.

-- 
Regards,
Pavel Roskin



More information about the Hostap mailing list