remove netlink fork

This commit is contained in:
John Smith 2023-05-29 17:09:29 -04:00
parent d2e926f8a2
commit bd928e6f09
6 changed files with 52 additions and 31 deletions

3
.gitmodules vendored
View File

@ -13,9 +13,6 @@
[submodule "external/keyvaluedb"] [submodule "external/keyvaluedb"]
path = external/keyvaluedb path = external/keyvaluedb
url = ../keyvaluedb.git url = ../keyvaluedb.git
[submodule "external/netlink"]
path = external/netlink
url = ../netlink.git
[submodule "external/libmdns"] [submodule "external/libmdns"]
path = external/libmdns path = external/libmdns
url = ../libmdns.git url = ../libmdns.git

32
Cargo.lock generated
View File

@ -3298,7 +3298,9 @@ dependencies = [
[[package]] [[package]]
name = "netlink-packet-core" name = "netlink-packet-core"
version = "0.4.1" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e5cf0b54effda4b91615c40ff0fd12d0d4c9a6e0f5116874f03941792ff535a"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"byteorder", "byteorder",
@ -3308,7 +3310,9 @@ dependencies = [
[[package]] [[package]]
name = "netlink-packet-route" name = "netlink-packet-route"
version = "0.10.0" version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea993e32c77d87f01236c38f572ecb6c311d592e56a06262a007fd2a6e31253c"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bitflags 1.3.2", "bitflags 1.3.2",
@ -3320,7 +3324,9 @@ dependencies = [
[[package]] [[package]]
name = "netlink-packet-utils" name = "netlink-packet-utils"
version = "0.5.0" version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ede8a08c71ad5a95cdd0e4e52facd37190977039a4704eb82a283f713747d34"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"byteorder", "byteorder",
@ -3330,19 +3336,24 @@ dependencies = [
[[package]] [[package]]
name = "netlink-proto" name = "netlink-proto"
version = "0.9.1" version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26305d12193227ef7b8227e7d61ae4eaf174607f79bd8eeceff07aacaefde497"
dependencies = [ dependencies = [
"bytes 1.4.0", "bytes 1.4.0",
"futures", "futures",
"log", "log",
"netlink-packet-core", "netlink-packet-core",
"netlink-sys", "netlink-sys",
"thiserror",
"tokio 1.28.2", "tokio 1.28.2",
] ]
[[package]] [[package]]
name = "netlink-sys" name = "netlink-sys"
version = "0.8.1" version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411"
dependencies = [ dependencies = [
"async-io", "async-io",
"bytes 1.4.0", "bytes 1.4.0",
@ -4469,14 +4480,19 @@ dependencies = [
[[package]] [[package]]
name = "rtnetlink" name = "rtnetlink"
version = "0.9.0" version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed7d42da676fdf7e470e2502717587dd1089d8b48d9d1b846dcc3c01072858cb"
dependencies = [ dependencies = [
"async-global-executor", "async-global-executor",
"futures", "futures",
"log", "log",
"netlink-packet-core",
"netlink-packet-route", "netlink-packet-route",
"netlink-packet-utils",
"netlink-proto", "netlink-proto",
"nix 0.22.3", "netlink-sys",
"nix 0.26.2",
"thiserror", "thiserror",
"tokio 1.28.2", "tokio 1.28.2",
] ]
@ -6131,6 +6147,8 @@ dependencies = [
"maplit", "maplit",
"ndk", "ndk",
"ndk-glue", "ndk-glue",
"netlink-packet-route",
"netlink-sys",
"nix 0.26.2", "nix 0.26.2",
"once_cell", "once_cell",
"owning_ref", "owning_ref",

View File

@ -14,18 +14,18 @@ exclude = [ "./external/keyring-manager", "./external/netlink", "./external/curs
cursive = { path = "./external/cursive/cursive" } cursive = { path = "./external/cursive/cursive" }
cursive_core = { path = "./external/cursive/cursive-core" } cursive_core = { path = "./external/cursive/cursive-core" }
netlink-sys = { path = "./external/netlink/netlink-sys" } # netlink-sys = { path = "./external/netlink/netlink-sys" }
netlink-packet-core = { path = "./external/netlink/netlink-packet-core" } # netlink-packet-core = { path = "./external/netlink/netlink-packet-core" }
netlink-packet-utils = { path = "./external/netlink/netlink-packet-utils" } # netlink-packet-utils = { path = "./external/netlink/netlink-packet-utils" }
#netlink-packet-generic = { path = "./external/netlink/netlink-packet-generic" } # #netlink-packet-generic = { path = "./external/netlink/netlink-packet-generic" }
netlink-packet-route = { path = "./external/netlink/netlink-packet-route" } # netlink-packet-route = { path = "./external/netlink/netlink-packet-route" }
#netlink-packet-audit = { path = "./external/netlink/netlink-packet-audit" } # #netlink-packet-audit = { path = "./external/netlink/netlink-packet-audit" }
#netlink-packet-sock-diag = { path = "./external/netlink/netlink-packet-sock-diag" } # #netlink-packet-sock-diag = { path = "./external/netlink/netlink-packet-sock-diag" }
netlink-proto = { path = "./external/netlink/netlink-proto" } # netlink-proto = { path = "./external/netlink/netlink-proto" }
#genetlink = { path = "./external/netlink/genetlink" } # #genetlink = { path = "./external/netlink/genetlink" }
rtnetlink = { path = "./external/netlink/rtnetlink" } # rtnetlink = { path = "./external/netlink/rtnetlink" }
#audit = { path = "./external/netlink/audit" } # #audit = { path = "./external/netlink/audit" }
#ethtool = { path = "./external/netlink/ethtool" } # #ethtool = { path = "./external/netlink/ethtool" }
[profile.release] [profile.release]
opt-level = "s" opt-level = "s"

1
external/netlink vendored

@ -1 +0,0 @@
Subproject commit bf542d210ec3c3f1c359b49036dc938ddfb3fdf9

View File

@ -15,8 +15,8 @@ crypto-test = ["enable-crypto-vld0", "enable-crypto-none"]
crypto-test-none = ["enable-crypto-none"] crypto-test-none = ["enable-crypto-none"]
enable-crypto-vld0 = [] enable-crypto-vld0 = []
enable-crypto-none = [] enable-crypto-none = []
rt-async-std = ["async-std", "async-std-resolver", "async_executors/async_std", "rtnetlink?/smol_socket", "veilid-tools/rt-async-std"] rt-async-std = ["async-std", "async-std-resolver", "async_executors/async_std", "rtnetlink/smol_socket", "veilid-tools/rt-async-std"]
rt-tokio = ["tokio", "tokio-util", "tokio-stream", "trust-dns-resolver/tokio-runtime", "async_executors/tokio_tp", "async_executors/tokio_io", "async_executors/tokio_timer", "rtnetlink?/tokio_socket", "veilid-tools/rt-tokio"] rt-tokio = ["tokio", "tokio-util", "tokio-stream", "trust-dns-resolver/tokio-runtime", "async_executors/tokio_tp", "async_executors/tokio_io", "async_executors/tokio_timer", "rtnetlink/tokio_socket", "veilid-tools/rt-tokio"]
rt-wasm-bindgen = ["veilid-tools/rt-wasm-bindgen", "async_executors/bindgen"] rt-wasm-bindgen = ["veilid-tools/rt-wasm-bindgen", "async_executors/bindgen"]
veilid_core_android_tests = ["dep:paranoid-android"] veilid_core_android_tests = ["dep:paranoid-android"]
@ -54,15 +54,19 @@ enumset = { version= "^1", features = ["serde"] }
backtrace = { version = "^0" } backtrace = { version = "^0" }
owo-colors = "^3" owo-colors = "^3"
stop-token = { version = "^0", default-features = false } stop-token = { version = "^0", default-features = false }
ed25519-dalek = { version = "^1", default_features = false, features = ["alloc", "u64_backend"] } ed25519-dalek = { version = "^1", default_features = false, features = ["alloc", "u64_backend"] }
x25519-dalek = { version = "^1", default_features = false, features = ["u64_backend"] } x25519-dalek = { version = "^1", default_features = false, features = ["u64_backend"] }
curve25519-dalek = { version = "^3", default_features = false, features = ["alloc", "u64_backend"] } curve25519-dalek = { version = "^3", default_features = false, features = ["alloc", "u64_backend"] }
blake3 = { version = "^1" } blake3 = { version = "^1" }
rtnetlink = { version = "^0", default-features = false, optional = true }
async-std-resolver = { version = "^0", optional = true } async-std-resolver = { version = "^0", optional = true }
trust-dns-resolver = { version = "^0", optional = true } trust-dns-resolver = { version = "^0", optional = true }
enum-as-inner = "=0.5.1" # temporary fix for trust-dns-resolver v0.22.0 enum-as-inner = "=0.5.1" # temporary fix for trust-dns-resolver v0.22.0
keyvaluedb = { path = "../external/keyvaluedb/keyvaluedb" } keyvaluedb = { path = "../external/keyvaluedb/keyvaluedb" }
rkyv = { version = "^0", default_features = false, features = ["std", "alloc", "strict", "size_32", "validation"] } rkyv = { version = "^0", default_features = false, features = ["std", "alloc", "strict", "size_32", "validation"] }
data-encoding = { version = "^2" } data-encoding = { version = "^2" }
weak-table = "0.3.2" weak-table = "0.3.2"
@ -138,8 +142,10 @@ paranoid-android = { version = "^0", optional = true }
ifstructs = "^0" ifstructs = "^0"
# Dependencies for Linux or Android # Dependencies for Linux or Android
[target.'cfg(any(target_os = "android",target_os = "linux"))'.dependencies] [target.'cfg(any(target_os = "android", target_os = "linux"))'.dependencies]
rtnetlink = { version = "^0", default-features = false } rtnetlink = { version = "^0", default-features = false}
netlink-sys = { version = "0.8" }
netlink-packet-route = { version = "0.15" }
# Dependencies for Windows # Dependencies for Windows
[target.'cfg(target_os = "windows")'.dependencies] [target.'cfg(target_os = "windows")'.dependencies]

View File

@ -7,15 +7,16 @@ use libc::{
close, if_indextoname, ioctl, socket, IFF_LOOPBACK, IFF_RUNNING, IF_NAMESIZE, SIOCGIFFLAGS, close, if_indextoname, ioctl, socket, IFF_LOOPBACK, IFF_RUNNING, IF_NAMESIZE, SIOCGIFFLAGS,
SOCK_DGRAM, SOCK_DGRAM,
}; };
use rtnetlink::packet::{ use netlink_packet_route::{
nlas::address::Nla, AddressMessage, AF_INET, AF_INET6, IFA_F_DADFAILED, IFA_F_DEPRECATED, nlas::address::Nla, AddressMessage, AF_INET, AF_INET6, IFA_F_DADFAILED, IFA_F_DEPRECATED,
IFA_F_OPTIMISTIC, IFA_F_PERMANENT, IFA_F_TEMPORARY, IFA_F_TENTATIVE, IFA_F_OPTIMISTIC, IFA_F_PERMANENT, IFA_F_TEMPORARY, IFA_F_TENTATIVE,
}; };
use rtnetlink::{new_connection_with_socket, Handle, IpVersion};
cfg_if! { cfg_if! {
if #[cfg(feature="rt-async-std")] { if #[cfg(feature="rt-async-std")] {
use rtnetlink::{new_connection_with_socket, sys::SmolSocket as RTNetLinkSocket, Handle, IpVersion}; use netlink_sys::{SmolSocket as RTNetLinkSocket};
} else if #[cfg(feature="rt-tokio")] { } else if #[cfg(feature="rt-tokio")] {
use rtnetlink::{new_connection_with_socket, sys::TokioSocket as RTNetLinkSocket, Handle, IpVersion}; use netlink_sys::{TokioSocket as RTNetLinkSocket};
} }
} }
use std::convert::TryInto; use std::convert::TryInto;