Skip to content

Commit

Permalink
Merge branch 'shadowsocks:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
arloor authored Sep 27, 2024
2 parents 2c5d4ba + 03d8c31 commit 2f66572
Show file tree
Hide file tree
Showing 23 changed files with 17,615 additions and 200 deletions.
23 changes: 2 additions & 21 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,5 @@ updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
ignore:
- dependency-name: libc
versions:
- 0.2.92
- dependency-name: tokio
versions:
- 1.4.0
- dependency-name: bloomfilter
versions:
- 1.0.5
- dependency-name: regex
versions:
- 1.4.5
- dependency-name: serde
versions:
- 1.0.124
- dependency-name: tower
versions:
- 0.4.6
interval: daily
open-pull-requests-limit: 50
46 changes: 23 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "shadowsocks-rust"
version = "1.20.4"
version = "1.21.0"
authors = ["Shadowsocks Contributors"]
description = "shadowsocks is a fast tunnel proxy that helps you bypass firewalls."
repository = "https://github.com/shadowsocks/shadowsocks-rust"
Expand Down Expand Up @@ -250,7 +250,7 @@ jemallocator = { version = "0.5", optional = true }
snmalloc-rs = { version = "0.3", optional = true }
rpmalloc = { version = "0.2", optional = true }

shadowsocks-service = { version = "1.20.4", path = "./crates/shadowsocks-service" }
shadowsocks-service = { version = "1.21.0", path = "./crates/shadowsocks-service" }

windows-service = { version = "0.7", optional = true }

Expand Down
12 changes: 6 additions & 6 deletions crates/shadowsocks-service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "shadowsocks-service"
version = "1.20.4"
version = "1.21.0"
authors = ["Shadowsocks Contributors"]
description = "shadowsocks is a fast tunnel proxy that helps you bypass firewalls."
repository = "https://github.com/shadowsocks/shadowsocks-rust"
Expand Down Expand Up @@ -175,7 +175,7 @@ rustls-native-certs = { version = "0.8", optional = true }
async-trait = "0.1"

socket2 = { version = "0.5", features = ["all"] }
libc = "0.2.141"
libc = "~0.2.141"

hyper = { version = "1.4", optional = true, features = ["full"] }
http-body-util = { version = "0.1", optional = true }
Expand All @@ -199,7 +199,7 @@ zstd = { version = "0.13", optional = true }
tun2 = { version = "3.1.4", optional = true, default-features = false, features = [
"async",
] }
etherparse = { version = "0.15", optional = true }
etherparse = { version = "0.16", optional = true }
smoltcp = { version = "0.11", optional = true, default-features = false, features = [
"std",
"log",
Expand All @@ -213,12 +213,12 @@ smoltcp = { version = "0.11", optional = true, default-features = false, feature

serde = { version = "1.0", features = ["derive"] }
json5 = "0.4"
bson = { version = "2.12.0", optional = true }
bson = { version = "2.13.0", optional = true }

shadowsocks = { version = "1.20.2", path = "../shadowsocks", default-features = false }
shadowsocks = { version = "1.21.0", path = "../shadowsocks", default-features = false }

# Just for the ioctl call macro
[target.'cfg(any(target_os = "macos", target_os = "ios", target_os = "freebsd"))'.dependencies]
[target.'cfg(any(target_os = "macos", target_os = "ios", target_os = "freebsd", target_os = "openbsd"))'.dependencies]
nix = { version = "0.29", features = ["ioctl"] }

[target.'cfg(windows)'.dependencies]
Expand Down
27 changes: 27 additions & 0 deletions crates/shadowsocks-service/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ cfg_if! {
/// Document: <https://www.freebsd.org/doc/handbook/firewalls-pf.html>
#[cfg(any(
target_os = "freebsd",
target_os = "openbsd",
target_os = "macos",
target_os = "ios"
))]
Expand Down Expand Up @@ -544,6 +545,30 @@ cfg_if! {
const AVAILABLE_TYPES: &[&str] = &[RedirType::PacketFilter.name(), RedirType::IpFirewall.name()];
AVAILABLE_TYPES
}
} else if #[cfg(target_os = "openbsd")] {
/// Default TCP transparent proxy solution on this platform
pub fn tcp_default() -> RedirType {
RedirType::PacketFilter
}

/// Available TCP transparent proxy types
#[doc(hidden)]
pub fn tcp_available_types() -> &'static [&'static str] {
const AVAILABLE_TYPES: &[&str] = &[RedirType::PacketFilter.name()];
AVAILABLE_TYPES
}

/// Default UDP transparent proxy solution on this platform
pub fn udp_default() -> RedirType {
RedirType::PacketFilter
}

/// Available UDP transparent proxy types
#[doc(hidden)]
pub const fn udp_available_types() -> &'static [&'static str] {
const AVAILABLE_TYPES: &[&str] = &[RedirType::PacketFilter.name()];
AVAILABLE_TYPES
}
} else if #[cfg(any(target_os = "macos", target_os = "ios"))] {
/// Default TCP transparent proxy solution on this platform
pub fn tcp_default() -> RedirType {
Expand Down Expand Up @@ -614,6 +639,7 @@ cfg_if! {

#[cfg(any(
target_os = "freebsd",
target_os = "openbsd",
target_os = "macos",
target_os = "ios"
))]
Expand Down Expand Up @@ -654,6 +680,7 @@ cfg_if! {

#[cfg(any(
target_os = "freebsd",
target_os = "openbsd",
target_os = "macos",
target_os = "ios",
))]
Expand Down
2 changes: 1 addition & 1 deletion crates/shadowsocks-service/src/local/dns/upstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub enum DnsClient {
stream: ProxyClientStream<MonProxyStream<ShadowTcpStream>>,
},
UdpRemote {
socket: MonProxySocket,
socket: MonProxySocket<ShadowUdpSocket>,
ns: Address,
control: UdpSocketControlData,
server_windows: LruCache<u64, PacketWindowFilter>,
Expand Down
4 changes: 2 additions & 2 deletions crates/shadowsocks-service/src/local/net/udp/association.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ where
peer_addr: SocketAddr,
bypassed_ipv4_socket: Option<ShadowUdpSocket>,
bypassed_ipv6_socket: Option<ShadowUdpSocket>,
proxied_socket: Option<MonProxySocket>,
proxied_socket: Option<MonProxySocket<ShadowUdpSocket>>,
keepalive_tx: mpsc::Sender<SocketAddr>,
keepalive_flag: bool,
balancer: PingBalancer,
Expand Down Expand Up @@ -409,7 +409,7 @@ where

#[inline]
async fn receive_from_proxied_opt(
socket: &Option<MonProxySocket>,
socket: &Option<MonProxySocket<ShadowUdpSocket>>,
buf: &mut Vec<u8>,
) -> io::Result<(usize, Address, Option<UdpSocketControlData>)> {
match *socket {
Expand Down
5 changes: 5 additions & 0 deletions crates/shadowsocks-service/src/local/redir/sys/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,10 @@ cfg_if! {
#[allow(dead_code, non_upper_case_globals, non_snake_case, non_camel_case_types)]
#[allow(clippy::useless_transmute, clippy::too_many_arguments, clippy::unnecessary_cast)]
mod pfvar;
} else if #[cfg(target_os = "openbsd")] {
#[path = "pfvar_bindgen_openbsd.rs"]
#[allow(dead_code, non_upper_case_globals, non_snake_case, non_camel_case_types)]
#[allow(clippy::useless_transmute, clippy::too_many_arguments, clippy::unnecessary_cast)]
mod pfvar;
}
}
Loading

0 comments on commit 2f66572

Please sign in to comment.