qcacmn: Filter out invalid BSSID from rx MGMT frame

Currently the driver accepts zero BSSID obtained from the
beacon/probe response and also allows to connect to them
by creating a peer, but since connection doesn't go
forward with the peer as BSSID is zero, the driver
deletes the peer, but since the BSSID is zero, the
host doesnt sends the peer delete to FW, which causes
a peer leak.

Fix is to filter out the beacons which has invalid BSSID,
and try to recreate the address from the addr2 which is
the FROM address in the MAC address. In case of AP the
BSSID and FROM address would be same, and hence BSSID
can be copied from the same.

Change-Id: I75842c2d80254aaffc31e689782be2eebc118466
CRs-Fixed: 2391346
2 files changed