Skip to content

BlueZ: mtu() panics when BlueZ doesn't expose MTU property #485

Description

@qdot

src/bluez/peripheral.rs:145: mtu() does characteristic.info.mtu.unwrap(). In bluez-async 0.8, CharacteristicInfo::mtu is Option<u16> and is None on BlueZ versions that don't expose the MTU property (< 5.62).

Failure scenario: discover_services() then mtu() on an older distro panics. The panic happens while holding the services std Mutex, poisoning it; afterwards services() and the notification stream also panic on lock().unwrap().

Fix direction: fall back to DEFAULT_MTU_SIZE when the property is absent.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bluez (linux)Issues related to the dbus/bluez corebugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions