• Luiz Augusto von Dentz's avatar
    Bluetooth: L2CAP: Fix responding with wrong PDU type · 9aa9d947
    Luiz Augusto von Dentz authored
    L2CAP_ECRED_CONN_REQ shall be responded with L2CAP_ECRED_CONN_RSP not
    L2CAP_LE_CONN_RSP:
    
    L2CAP LE EATT Server - Reject - run
      Listening for connections
      New client connection with handle 0x002a
      Sending L2CAP Request from client
      Client received response code 0x15
      Unexpected L2CAP response code (expected 0x18)
    L2CAP LE EATT Server - Reject - test failed
    
    > ACL Data RX: Handle 42 flags 0x02 dlen 26
          LE L2CAP: Enhanced Credit Connection Request (0x17) ident 1 len 18
            PSM: 39 (0x0027)
            MTU: 64
            MPS: 64
            Credits: 5
            Source CID: 65
            Source CID: 66
            Source CID: 67
            Source CID: 68
            Source CID: 69
    < ACL Data TX: Handle 42 flags 0x00 dlen 16
          LE L2CAP: LE Connection Response (0x15) ident 1 len 8
            invalid size
            00 00 00 00 00 00 06 00
    
    L2CAP LE EATT Server - Reject - run
      Listening for connections
      New client connection with handle 0x002a
      Sending L2CAP Request from client
      Client received response code 0x18
    L2CAP LE EATT Server - Reject - test passed
    
    Fixes: 15f02b91 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode")
    Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
    9aa9d947
l2cap_core.c 202 KB