Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"async" feature deps enables for "android" #47

Merged
merged 2 commits into from
Jun 7, 2022
Merged

"async" feature deps enables for "android" #47

merged 2 commits into from
Jun 7, 2022

Conversation

zonyitoo
Copy link
Contributor

@zonyitoo zonyitoo commented Jun 4, 2022

ref shadowsocks/shadowsocks-rust#856

rust-tun/src/lib.rs

Lines 30 to 38 in b60d4c2

#[cfg(all(
feature = "async",
any(
target_os = "linux",
target_os = "macos",
target_os = "ios",
target_os = "android"
)
))]

The async mod could be enabled for "android", but the dependencies' cfg missed target_os = "android"

@Voronar
Copy link

Voronar commented Jun 6, 2022

Packer protocol section also needs android support (maybe just add target_os = "android" together with target_os = "linux"?).

// Note: the protocol in the packet information header is platform dependent.
impl PacketProtocol {
#[cfg(target_os = "linux")]
fn into_pi_field(&self) -> Result<u16, io::Error> {
match self {
PacketProtocol::IPv4 => Ok(libc::ETH_P_IP as u16),
PacketProtocol::IPv6 => Ok(libc::ETH_P_IPV6 as u16),
PacketProtocol::Other(_) => Err(io::Error::new(
io::ErrorKind::Other,
"neither an IPv4 or IPv6 packet",
)),
}
}

@zonyitoo
Copy link
Contributor Author

zonyitoo commented Jun 7, 2022

@meh Hello meh, this PR is ready for review.

@meh meh merged commit 5606e45 into meh:master Jun 7, 2022
@zonyitoo zonyitoo deleted the patch-1 branch June 8, 2022 01:42
feifeigood pushed a commit to feifeigood/rust-tun that referenced this pull request Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants