obexapp: handle 32-bit uuid in ProtocolDescriptorList
Iain Hibbert
plunky at rya-online.net
Fri Dec 10 10:23:02 UTC 2010
Hi
I found that Mac OS X (10.3.5 at least, more recent probably not) provides
a 32-bit UUID for L2CAP in the OBEX records, this defeats obexapp trying
to send a file, eg from hcidump output
< ACL data: handle 13 flags 0x02 dlen 24
L2CAP(d): cid 0x0040 len 20 [psm 1]
SDP SSA Req: tid 0x1 len 0xf
pat uuid-16 0x1106 (OBEXObjTrnsf)
max 653
aid(s) 0x0004 - 0x0004
cont 00
> ACL data: handle 13 flags 0x02 dlen 40
L2CAP(d): cid 0x0044 len 36 [psm 1]
SDP SSA Rsp: tid 0x1 len 0x1f
count 28
record #0
aid 0x0004 (ProtocolDescList)
< < uuid-32 0x0100 (L2CAP) > <
uuid-16 0x0003 (RFCOMM) uint 0xf > <
uuid-16 0x0008 (OBEX) > >
cont 00
which returns 'Could not obtain RFCOMM channel' error
patch attached fixes this..
regards,
iain
-------------- next part --------------
--- sdp.c 2010-10-19 18:48:27.000000000 +0100
+++ sdp.c 2010-12-10 09:34:15.000000000 +0000
@@ -230,7 +230,16 @@ rfcomm_proto_list_parse(uint8_t *start,
goto next_protocol;
break;
- case SDP_DATA_UUID32: /* XXX FIXME can we have 32-bit UUID */
+ case SDP_DATA_UUID32:
+ if (end - start < 5)
+ rfcomm_proto_list_parse_exit(EINVAL);
+
+ SDP_GET32(value, start); len -= sizeof(uint32_t);
+ if (value != SDP_UUID_PROTOCOL_RFCOMM)
+ goto next_protocol;
+
+ break;
+
case SDP_DATA_UUID128: /* XXX FIXME can we have 128-bit UUID */
default:
rfcomm_proto_list_parse_exit(ENOATTR);
More information about the freebsd-bluetooth
mailing list