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

Commit 24104ae3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Floss: socket: Reject listening with the same service record" into main am: fc47a9ea

parents a624cc88 fc47a9ea
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -578,6 +578,14 @@ impl BluetoothSocketManager {
                log::debug!("service {} is blocked by admin policy", uuid);
                log::debug!("service {} is blocked by admin policy", uuid);
                return SocketResult::new(BtStatus::AuthRejected, INVALID_SOCKET_ID);
                return SocketResult::new(BtStatus::AuthRejected, INVALID_SOCKET_ID);
            }
            }
            if self
                .listening
                .iter()
                .any(|(_, v)| v.iter().any(|s| s.uuid.map_or(false, |u| u == uuid)))
            {
                log::warn!("Service {} already exists", uuid);
                return SocketResult::new(BtStatus::Fail, INVALID_SOCKET_ID);
            }
        }
        }


        // Create listener socket pair
        // Create listener socket pair