summaryrefslogtreecommitdiffhomepage
path: root/talpid-core/src
diff options
context:
space:
mode:
Diffstat (limited to 'talpid-core/src')
-rw-r--r--talpid-core/src/firewall/macos.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/talpid-core/src/firewall/macos.rs b/talpid-core/src/firewall/macos.rs
index 8f0ba7a897..e3bfa9870f 100644
--- a/talpid-core/src/firewall/macos.rs
+++ b/talpid-core/src/firewall/macos.rs
@@ -76,13 +76,12 @@ impl PacketFilter {
}
fn get_relay_rule(relay_endpoint: net::Endpoint) -> Result<pfctl::FilterRule> {
- let pfctl_endpoint = as_pfctl_endpoint(relay_endpoint);
let pfctl_proto = as_pfctl_proto(relay_endpoint.protocol);
pfctl::FilterRuleBuilder::default()
.action(pfctl::FilterRuleAction::Pass)
.direction(pfctl::Direction::Out)
- .to(pfctl_endpoint)
+ .to(relay_endpoint.address)
.proto(pfctl_proto)
.keep_state(pfctl::StatePolicy::Keep)
.tcp_flags(Self::get_tcp_flags())
@@ -169,17 +168,9 @@ impl PacketFilter {
}
}
-fn as_pfctl_endpoint(relay_endpoint: net::Endpoint) -> pfctl::Endpoint {
- pfctl::Endpoint::new(
- pfctl::Ip::from(relay_endpoint.address.ip()),
- pfctl::Port::from(relay_endpoint.address.port())
- )
-}
-
fn as_pfctl_proto(protocol: net::TransportProtocol) -> pfctl::Proto {
match protocol {
net::TransportProtocol::Udp => pfctl::Proto::Udp,
net::TransportProtocol::Tcp => pfctl::Proto::Tcp,
}
}
-