Skip to content

Commit

Permalink
Always destroy tunnel when reconfiguring
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkisemils committed Feb 7, 2024
1 parent d3ed3cd commit 66baa43
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ios/PacketTunnel/WireGuardAdapter/WgAdapter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ struct WgAdapter: TunnelAdapterProtocol {
func start(configuration: TunnelAdapterConfiguration) async throws {
let wgConfig = configuration.asWgConfig
do {
try await adapter.update(tunnelConfiguration: wgConfig)
try await adapter.stop()
try await adapter.start(tunnelConfiguration: wgConfig)
} catch WireGuardAdapterError.invalidState {
try await adapter.start(tunnelConfiguration: wgConfig)
}
Expand Down

0 comments on commit 66baa43

Please sign in to comment.