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

Commit fc47a9ea authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

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

parents c159d204 ae30b17c
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -578,6 +578,14 @@ impl BluetoothSocketManager {
                log::debug!("service {} is blocked by admin policy", uuid);
                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