• Doug Brown's avatar
    wifi: libertas: only add RSN/WPA IE in lbs_add_wpa_tlv · 57db1ba3
    Doug Brown authored
    The existing code only converts the first IE to a TLV, but it returns a
    value that takes the length of all IEs into account. When there is more
    than one IE (which happens with modern wpa_supplicant versions for
    example), the returned length is too long and extra junk TLVs get sent
    to the firmware, resulting in an association failure.
    
    Fix this by finding the first RSN or WPA IE and only adding that. This
    has the extra benefit of working properly if the RSN/WPA IE isn't the
    first one in the IE buffer.
    
    While we're at it, clean up the code to use the available structs like
    the other lbs_add_* functions instead of directly manipulating the TLV
    buffer.
    Signed-off-by: default avatarDoug Brown <doug@schmorgal.com>
    Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20230123053132.30710-3-doug@schmorgal.com
    57db1ba3
cfg.c 53.1 KB