Skip to content

Commit 36a4dc3

Browse files
committed
Merge remote-tracking branch 'origin/ignore-block-command-unsecured'
2 parents d867bd8 + 9e92126 commit 36a4dc3

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

talpid-core/src/tunnel_state_machine/disconnected_state.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use super::{
2-
ConnectingState, ErrorState, EventConsequence, SharedTunnelStateValues, TunnelCommand,
2+
ConnectingState, EventConsequence, SharedTunnelStateValues, TunnelCommand,
33
TunnelCommandReceiver, TunnelState, TunnelStateTransition,
44
};
5-
#[cfg(target_os = "macos")]
6-
use crate::dns;
75
use crate::firewall::FirewallPolicy;
6+
#[cfg(target_os = "macos")]
7+
use crate::{dns, tunnel_state_machine::ErrorState};
88
use futures::StreamExt;
99
#[cfg(target_os = "macos")]
1010
use std::net::Ipv4Addr;
@@ -205,10 +205,7 @@ impl TunnelState for DisconnectedState {
205205
SameState(self)
206206
}
207207
Some(TunnelCommand::Connect) => NewState(ConnectingState::enter(shared_values, 0)),
208-
Some(TunnelCommand::Block(reason)) => {
209-
Self::reset_dns(shared_values);
210-
NewState(ErrorState::enter(shared_values, reason))
211-
}
208+
Some(TunnelCommand::Block(_reason)) => SameState(self),
212209
#[cfg(target_os = "android")]
213210
Some(TunnelCommand::BypassSocket(fd, done_tx)) => {
214211
shared_values.bypass_socket(fd, done_tx);

talpid-core/src/tunnel_state_machine/disconnecting_state.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ impl DisconnectingState {
6868
AfterDisconnect::Nothing
6969
}
7070
Some(TunnelCommand::Connect) => AfterDisconnect::Reconnect(0),
71-
Some(TunnelCommand::Disconnect) | None => AfterDisconnect::Nothing,
72-
Some(TunnelCommand::Block(reason)) => AfterDisconnect::Block(reason),
71+
Some(TunnelCommand::Disconnect) | Some(TunnelCommand::Block(_)) | None => {
72+
AfterDisconnect::Nothing
73+
}
7374
#[cfg(target_os = "android")]
7475
Some(TunnelCommand::BypassSocket(fd, done_tx)) => {
7576
shared_values.bypass_socket(fd, done_tx);

talpid-core/src/tunnel_state_machine/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ pub enum TunnelCommand {
204204
Connect,
205205
/// Close tunnel connection.
206206
Disconnect,
207-
/// Disconnect any open tunnel and block all network access
207+
/// Block all network access unless tunnel is disconnecting or disconnected
208208
Block(ErrorStateCause),
209209
/// Bypass a socket, allowing traffic to flow through outside the tunnel.
210210
#[cfg(target_os = "android")]

0 commit comments

Comments
 (0)