obexd: Fix not checking if GoepL2capPsm contains a valid PSM

In case the PSM is not valid ignore it so we are still able to connect
to RFCOMM.
This commit is contained in:
Luiz Augusto von Dentz 2012-05-15 19:16:46 +03:00 committed by Marcel Holtmann
parent b8c8567c3d
commit 1282ed28f0

View File

@ -261,7 +261,8 @@ static void search_callback(uint8_t type, uint16_t status,
}
data = sdp_data_get(rec, 0x0200);
if (data != NULL)
/* PSM must be odd and lsb of upper byte must be 0 */
if (data != NULL && (data->val.uint16 & 0x0101) == 0x0001)
ch = data->val.uint16;
sdp_record_free(rec);