From 39c8d5fb3c52edf39046bc3d6e802153e3aed310 Mon Sep 17 00:00:00 2001 From: zonyitoo Date: Mon, 8 Feb 2021 09:31:29 +0800 Subject: [PATCH] resolved OUTBOUND_BIND_INTERFACE duplication ref shadowsocks/shadowsocks-android#2667 --- bin/sslocal.rs | 2 +- bin/ssmanager.rs | 9 ++++++++- bin/ssserver.rs | 9 ++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/bin/sslocal.rs b/bin/sslocal.rs index 25b776b3..8867c5a0 100644 --- a/bin/sslocal.rs +++ b/bin/sslocal.rs @@ -108,7 +108,7 @@ fn main() { ); } - #[cfg(any(target_os = "linux", target_os = "android", target_os = "macos", target_os = "ios"))] + #[cfg(any(target_os = "macos", target_os = "ios"))] { app = clap_app!(@app (app) (@arg OUTBOUND_BIND_INTERFACE: --("outbound-bind-interface") +takes_value "Set IP_BOUND_IF option for outbound socket") diff --git a/bin/ssmanager.rs b/bin/ssmanager.rs index ac9ec8ec..1d1d732f 100644 --- a/bin/ssmanager.rs +++ b/bin/ssmanager.rs @@ -88,8 +88,15 @@ fn main() { #[cfg(any(target_os = "linux", target_os = "android"))] { app = clap_app!(@app (app) - (@arg OUTBOUND_FWMARK: --("outbound-fwmark") +takes_value {validator::validate_u32} "Set SO_MARK option for outbound socket") (@arg OUTBOUND_BIND_INTERFACE: --("outbound-bind-interface") +takes_value "Set SO_BINDTODEVICE option for outbound socket") + (@arg OUTBOUND_FWMARK: --("outbound-fwmark") +takes_value {validator::validate_u32} "Set SO_MARK option for outbound socket") + ); + } + + #[cfg(any(target_os = "macos", target_os = "ios"))] + { + app = clap_app!(@app (app) + (@arg OUTBOUND_BIND_INTERFACE: --("outbound-bind-interface") +takes_value "Set IP_BOUND_IF option for outbound socket") ); } diff --git a/bin/ssserver.rs b/bin/ssserver.rs index a0ec3df6..ffe04238 100644 --- a/bin/ssserver.rs +++ b/bin/ssserver.rs @@ -95,8 +95,15 @@ fn main() { #[cfg(any(target_os = "linux", target_os = "android"))] { app = clap_app!(@app (app) - (@arg OUTBOUND_FWMARK: --("outbound-fwmark") +takes_value {validator::validate_u32} "Set SO_MARK option for outbound socket") (@arg OUTBOUND_BIND_INTERFACE: --("outbound-bind-interface") +takes_value "Set SO_BINDTODEVICE option for outbound socket") + (@arg OUTBOUND_FWMARK: --("outbound-fwmark") +takes_value {validator::validate_u32} "Set SO_MARK option for outbound socket") + ); + } + + #[cfg(any(target_os = "macos", target_os = "ios"))] + { + app = clap_app!(@app (app) + (@arg OUTBOUND_BIND_INTERFACE: --("outbound-bind-interface") +takes_value "Set IP_BOUND_IF option for outbound socket") ); }