cfg80211: Avoid sending IWEVASSOCREQIE and IWEVASSOCRESPIE events with NULL event...
authorNishant Sarmukadam <nishants@marvell.com>
Thu, 15 Apr 2010 05:03:02 +0000 (22:03 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 16 Apr 2010 19:32:00 +0000 (15:32 -0400)
commit7834704be4777fc0ed67c4486ef8c5691078d135
tree564172ac8ae0a31bb47d4a22d2bad043ed9bad8d
parent61c2a80b960361a930a4e3c4c0df694713b9dafd
cfg80211: Avoid sending IWEVASSOCREQIE and IWEVASSOCRESPIE events with NULL event body

In a scenario, where a cfg80211 driver (station mode) does not send assoc request
and assoc response IEs in cfg80211_connect_result after a successful association
to an AP, cfg80211 sends IWEVASSOCREQIE and IWEVASSOCRESPIE to the user space
application with NULL data. This can cause an issue at the event recipient.

An example of this is when cfg80211 sends IWEVASSOCREQIE and IWEVASSOCRESPIE
events with NULL event body to wpa_supplicant. The wpa_supplicant overwrites
the assoc request and assoc response IEs for this station with NULL data.
If the association is WPA/WPA2, the wpa_supplicant is not able to generate
EAPOL handshake messages, since the IEs are NULL.

With the patch, req_ie and resp_ie will be NULL by avoiding the
assignment if the driver has not sent the IEs to cfg80211. The event sending
code sends the events only if resp_ie and req_ie are not NULL. This
will ensure that the events are not sent with NULL event body.

Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/wireless/sme.c