Open zonyitoo opened 2 years ago
These lines in src/phy/sys/mod.rs
should be changed to:
#[cfg(all(
feature = "phy-raw_socket",
any(target_os = "macos", target_os = "openbsd"),
unix
))]
pub mod bpf;
#[cfg(all(
feature = "phy-raw_socket",
any(target_os = "macos", target_os = "openbsd"),
unix
))]
pub use self::bpf::BpfDevice as RawSocketDesc;
On the other hand, the src/phy/sys/raw_socket.rs
can only be enabled for Linux, Android, macOS, OpenBSD.
I use this temporary solution to fix my issues.
Change smoltcp = "0.8.2"
to smoltcp = { version = "0.8.2", default-features = false, features = ["proto-ipv4"] }
in the Cargo.toml
Original issue: https://github.com/shadowsocks/shadowsocks-rust/issues/797#issuecomment-1081339878
It seems that some constants, like
BIOCSETIF
,BPF_HDRLEN
is only available for#[cfg(any(target_os = "macos", target_os = "openbsd"))]
.