From: Ariel Gertzenstein Date: Fri, 31 Jan 2014 21:39:43 +0000 (-0800) Subject: DO NOT MERGE Fix bug in PAN code where no new PAN connections can be made. X-Git-Tag: android-x86-7.1-r1~1281^2~54^2~12 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=34fa499c449b8e464cb417a9e8dce4eb027b4a30;p=android-x86%2Fsystem-bt.git DO NOT MERGE Fix bug in PAN code where no new PAN connections can be made. If you call PAN_connect() followed quickly by PAN_disconnect(), you won't be able to establish any additional PANU connections. This happens because the connection never has a chance to make it into PAN_STATE_CONNECTED and num_conns only gets decremented if you disconnect in the connected state. As a result, subsequent calls to connect will fail because the stack still believes there to be an existing connection. Change-Id: Id24873828ca4f517496cb19a44993d0e8e837a1e --- diff --git a/stack/pan/pan_api.c b/stack/pan/pan_api.c index f9742ed2d..e6275ea02 100644 --- a/stack/pan/pan_api.c +++ b/stack/pan/pan_api.c @@ -466,7 +466,7 @@ tPAN_RESULT PAN_Disconnect (UINT16 handle) } result = BNEP_Disconnect (pcb->handle); - if (pcb->con_state == PAN_STATE_CONNECTED) + if (pcb->con_state != PAN_STATE_IDLE) pan_cb.num_conns--; if (pan_cb.pan_bridge_req_cb && pcb->src_uuid == UUID_SERVCLASS_NAP)