Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2b345c9 authored by Rahul Arya's avatar Rahul Arya Committed by Thomas Girardier
Browse files

Ignore LMP packets without an active link

If we disconnect, we immediately clear the link, but there may still be incoming packets over the PHY. We should just ignore these packets rather than crashing.

Change-Id: I681071476a5b30abbb1c1147d09255d2aae379c4
Merged-In: I681071476a5b30abbb1c1147d09255d2aae379c4
Ignore-AOSP-First: cherry-pick from AOSP
Test: PTS
Bug: 243698555
Bug: 245578454
Tag: #stability
parent ac6e3f9e
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -111,8 +111,9 @@ impl LinkManager {
        from: hci::Address,
        packet: lmp::PacketPacket,
    ) -> Result<(), LinkManagerError> {
        let link = self.get_link(from).ok_or(LinkManagerError::UnknownPeer)?;
        if let Some(link) = self.get_link(from) {
            link.ingest_lmp(packet);
        };
        Ok(())
    }

@@ -123,8 +124,9 @@ impl LinkManager {
            .or_else(|| hci::command_remote_device_address(&command));

        if let Some(peer) = peer {
            let link = self.get_link(peer).ok_or(LinkManagerError::UnknownPeer)?;
            if let Some(link) = self.get_link(peer) {
                link.ingest_hci(command);
            };
            Ok(())
        } else {
            Err(LinkManagerError::UnhandledHciPacket)