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

RE: [bluetooth-dev] bug in l2cap.c line 2227



Hi,
looks like the remains from the old static psm registration.
You can simply remove the check since the validity of psm is already checked in l2ca_connect_req.
thanks !
brgds
Mattias

-----Original Message-----
From: David LIBAULT [mailto:david.libault@xxxxxxx.fr]
Sent: den 2 november 2000 09:15
To: bluetooth-dev@xxxxxxx.com
Subject: [bluetooth-dev] bug in l2cap.c line 2227


Hi,

In l2cap.c, function l2ca_connect_cfm, line 2227 we have :

if (con->psm > MAX_PSM)
  return;

So, if the test_conn command is issued (psm=0x1231), the l2cap channel
is opened but never goes thru the configuration process...
I propose replacing these lines by :

 /* Check PSM */
 if ((con->psm % 2) == 0) {
  D_ERR("l2ca_connect_cfm : incorrect PSM value\n");
  return ;
 }
 if ((con->psm > MAX_PSM) && (con->psm < MIN_DYNAMIC_PSM)) {
  D_ERR("l2ca_connect_cfm : value of PSM preserved\n");
  return ;
 }
 if (con->psm > MAX_DYNAMIC_PSM) {
  D_ERR("l2ca_connect_cfm : PSM value not valid\n");
  return ;
 }

(same as what is done in function l2ca_connect_req )

The test cases work fine.

David.


-
To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to majordomo@xxxxxxx.com
-
To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to majordomo@xxxxxxx.com