Odd l2cap_sock.c Code?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/bluetooth/l2cap_sock.c

Per the bluetooth core spec
https://www.bluetooth.com/specifications/bluetooth-core-specification
Page 2184, section 3.4.2.1 Exchange MTU Request, PDUs may be sent to
negotiate MTU size upon connection

Line 415 in l2cap_sock.c, if address types being used are Bluetooth 2 types,
it looks like setsockopt(xx, SOL_L2CAP, L2CAP_OPTIONS, xx, xx) is
INTENDED to fail with EINVAL errno, but for Bluetooth 2.x connections
it would work fine.

Line 920 - setsockopt(xx,SOL_BLUETOOTH,BT_RCVMTU,xx,xx) looks to be
INTENDED to fail if a connection is already established on the socket

The legacy kernel code goes and sets imtu and omtu without any other code.

Per the bluetooth spec - inbound and outbound MTU should be set to the
minimum MTU between the devices during this ATT PDU handshake.

As it stands right now, it looks like the kernel would require
disconnecting\reconnecting the socket.

I bet it could be changed to mirror the old setsockopt SOL_L2CAP code,
so BT2 behaves like BT4+ - but it's not my code and I'm not a BT guru
so I'd hate to just submit a patch for it.

Is this all intentional?

It seems like both imtu and omtu should be allowed to be set in the
new code, like the legacy code.

Thanks!
Dylan



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux