diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2023-03-02 14:50:16 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2023-03-02 14:50:16 +0100 |
| commit | 84ed0fb555356e1543b7df5b17bc04ab501d7d76 (patch) | |
| tree | a9b975165298f8ff8c7ec924d55bfdbcb2616596 | |
| parent | 0d7d8c6e6c504d0a3065bfa79aba5c89bb037bc5 (diff) | |
| parent | 3a0aad89628e118d98b0546021c6697106332d67 (diff) | |
| download | mullvadvpn-84ed0fb555356e1543b7df5b17bc04ab501d7d76.tar.xz mullvadvpn-84ed0fb555356e1543b7df5b17bc04ab501d7d76.zip | |
Merge branch 'pinger-lock-send'
| -rw-r--r-- | ios/PacketTunnel/TunnelMonitor/Pinger.swift | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ios/PacketTunnel/TunnelMonitor/Pinger.swift b/ios/PacketTunnel/TunnelMonitor/Pinger.swift index 60098eb99b..65d5bd9458 100644 --- a/ios/PacketTunnel/TunnelMonitor/Pinger.swift +++ b/ios/PacketTunnel/TunnelMonitor/Pinger.swift @@ -132,11 +132,11 @@ final class Pinger { /// Returns `SendResult` on success, otherwise throws a `Pinger.Error`. func send(to address: IPv4Address) throws -> SendResult { stateLock.lock() + defer { stateLock.unlock() } + guard let socket = socket else { - stateLock.unlock() throw Error.closedSocket } - stateLock.unlock() var sa = sockaddr_in() sa.sin_len = UInt8(MemoryLayout.size(ofValue: sa)) |
