OSDN Git Service

RFCOMM: Refuse connection if max RFCOMM ports are used
authorVenkata Jagadeesh Garaga <quic_vgaraga@quicinc.com>
Thu, 2 Jan 2020 07:16:01 +0000 (12:46 +0530)
committerMyles Watson <mylesgw@google.com>
Fri, 7 Feb 2020 14:27:45 +0000 (14:27 +0000)
commit3622c2517f19ce2c22d34b398f601c9b3239586a
tree7ec61ef184ffdcd94736196e6e65001c41a12dc7
parentbe7a88318fafc095959c4beb96de19c4283908f4
RFCOMM: Refuse connection if max RFCOMM ports are used

Issue:
When max RFCOMM ports are used, the stack returns the current listening
port as new port while accepting the incoming RFCOMM connection.
This leads to an assert.

Steps to reproduce
==================
1. Connect DUT with RFCOMM clients until all 30 RFCOMM ports used.
   (DUT using 17 ports for RFCOMM servers and 13 ports for clients)
3. Initiate SPP connection from remote to DUT

Bluetooth restarted due to assert in RFCOMM

Expected results: Incoming connection fails
Fix: Return null instead of current listening port when new port
     creation fails

Test: Simulated scenario by reducing max rfc ports and tested
Bug: 147075796
Change-Id: I46cd8e6707575e9cb92670136c9d6e4b9988eb53
bta/jv/bta_jv_act.cc