fix: Update netstat2 from 0.9.1 to 0.11.2 to resolve libc compatibility

Resolved compilation error where netstat2 v0.9.1 was accessing
tcp_info.state instead of tcp_info.tcpi_state on Linux systems.
The latest version 0.11.2 includes the fix for this field name change.
This commit is contained in:
Claude
2025-11-04 22:14:40 +00:00
parent 3b1b81a893
commit 701decfc55
2 changed files with 70 additions and 5 deletions

73
Cargo.lock generated
View File

@@ -441,6 +441,8 @@ dependencies = [
"cexpr",
"clang-sys",
"itertools 0.13.0",
"log",
"prettyplease",
"proc-macro2",
"quote",
"regex",
@@ -2298,17 +2300,70 @@ dependencies = [
]
[[package]]
name = "netstat2"
version = "0.9.1"
name = "netlink-packet-core"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0faa3f4ad230fd2bf2a5dad71476ecbaeaed904b3c7e7e5b1f266c415c03761f"
checksum = "72724faf704479d67b388da142b186f916188505e7e0b26719019c525882eda4"
dependencies = [
"anyhow",
"byteorder",
"netlink-packet-utils",
]
[[package]]
name = "netlink-packet-sock-diag"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a495cb1de50560a7cd12fdcf023db70eec00e340df81be31cedbbfd4aadd6b76"
dependencies = [
"anyhow",
"bitflags 1.3.2",
"byteorder",
"libc",
"netlink-packet-core",
"netlink-packet-utils",
"smallvec",
]
[[package]]
name = "netlink-packet-utils"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ede8a08c71ad5a95cdd0e4e52facd37190977039a4704eb82a283f713747d34"
dependencies = [
"anyhow",
"byteorder",
"paste",
"thiserror 1.0.69",
]
[[package]]
name = "netlink-sys"
version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16c903aa70590cb93691bf97a767c8d1d6122d2cc9070433deb3bbf36ce8bd23"
dependencies = [
"bytes",
"libc",
"log",
]
[[package]]
name = "netstat2"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "496f264d3ead4870d6b366deb9d20597592d64aac2a907f3e7d07c2325ba4663"
dependencies = [
"bindgen",
"bitflags 2.10.0",
"byteorder",
"netlink-packet-core",
"netlink-packet-sock-diag",
"netlink-packet-utils",
"netlink-sys",
"num-derive 0.3.3",
"num-traits",
"thiserror 1.0.69",
"thiserror 2.0.17",
]
[[package]]
@@ -3072,6 +3127,16 @@ dependencies = [
"zerocopy",
]
[[package]]
name = "prettyplease"
version = "0.2.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
dependencies = [
"proc-macro2",
"syn 2.0.108",
]
[[package]]
name = "proc-macro2"
version = "1.0.103"

View File

@@ -6,6 +6,6 @@ edition = "2024"
[dependencies]
get_if_addrs = "0.5.3"
os_info = "3.8"
netstat2 = "0.9"
netstat2 = "0.11.2"
sysinfo = "0.30"
users = "0.11"