Skip to content

Commit 4d5665a

Browse files
committed
Remove listen PCB when opening new connection
1 parent 3cb9d09 commit 4d5665a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lwbt/l2cap.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,9 @@ void l2cap_process_sig(struct pbuf *q, struct l2cap_hdr *l2caphdr, struct bd_add
342342

343343
pcb->state = L2CAP_CONFIG;
344344
L2CAP_REG(&l2cap_active_pcbs, pcb);
345+
346+
/* Free the listening pcb, don't need it anymore */
347+
l2cap_close((struct l2cap_pcb *)lpcb);
345348

346349
LOG("l2cap_process_sig: A connection request was received. Send a response\n");
347350
data = btpbuf_alloc(PBUF_RAW, L2CAP_CONN_RSP_SIZE, PBUF_RAM);

0 commit comments

Comments
 (0)