20 Jun 2012 11:02
[PATCH] sdp: Prevent duplicate records registration
Check if a record with same UUID and protocol descriptor already exists
before adding new record to server
---
When BlueZ is built with --enable-pnat option, it provides DUN support on RFComm
port 1.
When current version of oFono is started, it also provides DUN support on same
port.
So, we get to 2 SDP records for same UUID and RFComm port.
This patch prevents this.
src/sdpd-service.c | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/src/sdpd-service.c b/src/sdpd-service.c
index 39e05ab..9e8b90c 100644
--- a/src/sdpd-service.c
+++ b/src/sdpd-service.c
<at> <at> -235,6 +235,9 <at> <at> int add_record_to_server(const bdaddr_t *src, sdp_record_t *rec)
{
sdp_data_t *data;
sdp_list_t *pattern;
+ sdp_list_t *record;
+ sdp_list_t *protos;
+ int port = -1, psm = -1;
if (rec->handle == 0xffffffff) {
rec->handle = sdp_next_handle();
<at> <at> -245,6 +248,38 <at> <at> int add_record_to_server(const bdaddr_t *src, sdp_record_t *rec)
return -EEXIST;
(Continue reading)
RSS Feed