OSDN Git Service

L2CAP ERTM: Fix p_ccb->max_rx_mtu
authorHansong Zhang <hsz@google.com>
Sun, 27 Sep 2020 06:38:13 +0000 (23:38 -0700)
committerHansong Zhang <hsz@google.com>
Sun, 27 Sep 2020 06:42:27 +0000 (23:42 -0700)
Use the old value, which was removed in
I78c3d65fdaf14addf80607ce5105221e52447a9e.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working & OPP
Change-Id: I90a8f94d16f87df2d4ce8bb0de8130d544affd12

stack/l2cap/l2c_utils.cc

index 56b12b8..deac03d 100644 (file)
@@ -1368,7 +1368,8 @@ tL2C_CCB* l2cu_allocate_ccb(tL2C_LCB* p_lcb, uint16_t cid) {
   alarm_free(p_ccb->fcrb.mon_retrans_timer);
   p_ccb->fcrb.mon_retrans_timer = alarm_new("l2c_fcrb.mon_retrans_timer");
 
-  p_ccb->max_rx_mtu = L2CAP_MTU_SIZE;
+  p_ccb->max_rx_mtu = BT_DEFAULT_BUFFER_SIZE -
+                      (L2CAP_MIN_OFFSET + L2CAP_SDU_LEN_OFFSET + L2CAP_FCS_LEN);
   p_ccb->tx_mps = BT_DEFAULT_BUFFER_SIZE - 32;
 
   p_ccb->xmit_hold_q = fixed_queue_new(SIZE_MAX);