/* AirPDcapGetBssidAddress() and AirPDcapGetBssidAddress() are used for key caching. In each case, it's more important to return a value than to return a  */
static const UCHAR * AirPDcapGetStaAddress(const AIRPDCAP_MAC_FRAME_ADDR4 *frame)
/* AirPDcapGetBssidAddress() and AirPDcapGetBssidAddress() are used for key caching. In each case, it's more important to return a value than to return a  */
static const UCHAR * AirPDcapGetStaAddress(const AIRPDCAP_MAC_FRAME_ADDR4 *frame)
{
    switch(AIRPDCAP_DS_BITS(frame->fc[1])) {
        case 0:
            if (memcmp(frame->addr2, frame->addr3, AIRPDCAP_MAC_LEN) == 0)
                return frame->addr1;
            else
                return frame->addr2;
        case 1:
            return frame->addr2;
        case 2:
            return frame->addr1;
        case 3:
            if (memcmp(frame->addr1, frame->addr2, AIRPDCAP_MAC_LEN) < 0)
                return frame->addr1;
            else
                return frame->addr2;
        default:
            return NULL;
    }
}