If a device sends an MTU that is bigger than our maximum tx buffer size,
that could cause assertion failures down the line.
This PR limits it to the maximum we support (CONFIG_BT_L2CAP_TX_MTU).
The issue has been observed with a gatt discovery procedure, but is likely
present in other places in att.c.
To reproduce it, we need two zephyr shell devices, with one having a larger
MTU than the other:
- connect
- do data length update to the bigger MTU
- set security to 2, EATT channels get connected
- launch a gatt discovery from the device with the larger MTU
- observe kernel panic on the other device when it attempts to add too much
memory to a net buf.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>