[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bluetooth-dev] Bugs in the last release of L2CAP + PSM

Hi Mats,

I have discovered some bugs that have been added in the last release of L2CAP.

In the file l2cap.c:
1.  line 866, 
have to be removed since "con" is now deleted by the function 		l2ca_disconnect_cfm(con,0); on the previous line.
In fact, those two macros have to be moved in the function l2ca_disconnect_cfm() just after the lines:
	/* tell upper layers that connection is down */
	l2cap->upper_layers[con->psm].disc_cfm(con, result);

2. In the same function l2ca_disconnect_cfm(), the line
	if (count_con(con->hci_con_handle) == 0) {
has to be modified as follows
	if (count_con(tmp_hdl) == 0) {
since "con" has been deleted on the previous line.

3. line 846, the trace in the SIG_DISCRSP case is incorrect: 
	PRINTPKT(FNC"config response", rsp->data, rsp->len); must be replaced by PRINTPKT(FNC"disconnect response", rsp->data, rsp->len);

Concerning the PSM, it must be at least of type u16 (probably u32!) since the range of dynamically assigned values is [0x1001-0xFFFF] (See p:278 Core specification).
But it is also written on this page that the PSM field can be extended beyond 16 bits ...

So, the declaration of the functions  lines 221, 222, 223 in l2cap.h must be modified:
	s32 l2cap_register_upper(u8 psm, struct protocol_layer *prot);
	s32 l2cap_unregister_upper(u8 psm);
	s32 l2cap_is_registered(u8 psm);
The same modifications must be done in the file l2cap.c of course!


Mathieu GONOT

International Technology Centre Leuven
Interleuvenlaan 74-76
B-3001 Leuven-Belgium

Tel. +32 16 390 652