Bluetooth: L2CAP: Fix sending MPS that cannot be fully used
MPS shall never be bigger than MTU + 2 as the remaining bytes cannot be used since the SDU is limited to length + MTU. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
parent
0356590df5
commit
5115cb16cf
1 changed files with 4 additions and 1 deletions
|
@ -635,7 +635,10 @@ static void l2cap_chan_rx_init(struct bt_l2cap_le_chan *chan)
|
|||
}
|
||||
}
|
||||
|
||||
chan->rx.mps = L2CAP_MAX_LE_MPS;
|
||||
/* MPS shall not be bigger than MTU + 2 as the remaining bytes cannot
|
||||
* be used.
|
||||
*/
|
||||
chan->rx.mps = min(chan->rx.mtu + 2, L2CAP_MAX_LE_MPS);
|
||||
k_sem_init(&chan->rx.credits, 0, UINT_MAX);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue