mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-28 08:37:22 +00:00
Fixed connection request handling, read UUIDs in network byte order
Initialise service struct memory after allocation
This commit is contained in:
parent
bb82004450
commit
34e07d98fe
@ -612,8 +612,8 @@ static int bnep_handle_connection_request(bnep_channel_t *channel, uint8_t *pack
|
||||
|
||||
/* Check source and destination UUIDs for valid combinations */
|
||||
if (response_code == BNEP_RESP_SETUP_SUCCESS) {
|
||||
channel->uuid_dest = READ_BT_16(packet, 2 + uuid_offset);
|
||||
channel->uuid_source = READ_BT_16(packet, 2 + uuid_offset + uuid_size);
|
||||
channel->uuid_dest = READ_NET_16(packet, 2 + uuid_offset);
|
||||
channel->uuid_source = READ_NET_16(packet, 2 + uuid_offset + uuid_size);
|
||||
|
||||
if ((channel->uuid_dest != BNEP_UUID_PANU) &&
|
||||
(channel->uuid_dest != BNEP_UUID_NAP) &&
|
||||
@ -1377,6 +1377,7 @@ void bnep_register_service(void * connection, uint16_t service_uuid, uint16_t ma
|
||||
bnep_emit_service_registered(connection, BTSTACK_MEMORY_ALLOC_FAILED, service_uuid);
|
||||
return;
|
||||
}
|
||||
memset(service, 0, sizeof(bnep_service_t));
|
||||
|
||||
/* register with l2cap if not registered before, max MTU */
|
||||
l2cap_register_service_internal(NULL, bnep_packet_handler, PSM_BNEP, 0xffff, bnep_security_level);
|
||||
|
Loading…
x
Reference in New Issue
Block a user