From d6dd40e80e7bed567b51ed48877f1a36f13615b6 Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Tue, 5 Dec 2023 04:21:59 -0500 Subject: [PATCH 1/2] rtnetlink 0.13 rtnetlink stopped re-exporting the netlink crates, hence the new crates added. They're the subset of what was prior re-exported which remain relevant. The benefit of this is just various incompatible version bumps, including nix, a few removed asserts from rtnetlink, and the accumulation of bug fixes from the netlink crates. --- Cargo.toml | 6 +++++- src/linux.rs | 17 +++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b67837b..e99b006 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,11 @@ ipnet = "2.3.1" log = "0.4.14" [target.'cfg(target_os = "linux")'.dependencies] -rtnetlink = { version = "0.10.0", default-features = false } +netlink-sys = { version = "0.8.0", default-features = false } +netlink-packet-core = { version = "0.7.0", default-features = false } +netlink-packet-route = { version = "0.17.0", default-features = false } +netlink-proto = { version = "0.11.0", default-features = false } +rtnetlink = { version = "0.13.0", default-features = false } [target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies] core-foundation = "0.9.2" diff --git a/src/linux.rs b/src/linux.rs index 6fa3ab1..9b93882 100644 --- a/src/linux.rs +++ b/src/linux.rs @@ -4,10 +4,11 @@ use futures::ready; use futures::stream::{FusedStream, Stream, TryStreamExt}; use futures::StreamExt; use rtnetlink::constants::{RTMGRP_IPV4_IFADDR, RTMGRP_IPV6_IFADDR}; -use rtnetlink::packet::address::nlas::Nla; -use rtnetlink::packet::{AddressMessage, RtnlMessage}; -use rtnetlink::proto::{Connection, NetlinkPayload}; -use rtnetlink::sys::{AsyncSocket, SocketAddr}; +use netlink_packet_route::rtnl::address::nlas::Nla; +use netlink_packet_route::rtnl::{AddressMessage, RtnlMessage}; +use netlink_packet_core::NetlinkPayload; +use netlink_proto::Connection; +use netlink_sys::{AsyncSocket, SocketAddr}; use std::collections::VecDeque; use std::future::Future; use std::io::{Error, ErrorKind, Result}; @@ -17,8 +18,8 @@ use std::task::{Context, Poll}; #[cfg(feature = "tokio")] pub mod tokio { - //! An interface watcher that uses `rtnetlink`'s [`TokioSocket`](rtnetlink::sys::TokioSocket) - use rtnetlink::sys::TokioSocket; + //! An interface watcher that uses `netlink`'s [`TokioSocket`](netlink_sys::TokioSocket) + use netlink_sys::TokioSocket; /// Watches for interface changes. pub type IfWatcher = super::IfWatcher; @@ -26,8 +27,8 @@ pub mod tokio { #[cfg(feature = "smol")] pub mod smol { - //! An interface watcher that uses `rtnetlink`'s [`SmolSocket`](rtnetlink::sys::SmolSocket) - use rtnetlink::sys::SmolSocket; + //! An interface watcher that uses `netlink`'s [`SmolSocket`](netlink_sys::SmolSocket) + use netlink_sys::SmolSocket; /// Watches for interface changes. pub type IfWatcher = super::IfWatcher; From 77448415e3c37847b009efc772bf1cd67b385e71 Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Tue, 5 Dec 2023 07:08:02 -0500 Subject: [PATCH 2/2] cargo fmt --- src/linux.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/linux.rs b/src/linux.rs index 9b93882..df12786 100644 --- a/src/linux.rs +++ b/src/linux.rs @@ -3,12 +3,12 @@ use fnv::FnvHashSet; use futures::ready; use futures::stream::{FusedStream, Stream, TryStreamExt}; use futures::StreamExt; -use rtnetlink::constants::{RTMGRP_IPV4_IFADDR, RTMGRP_IPV6_IFADDR}; +use netlink_packet_core::NetlinkPayload; use netlink_packet_route::rtnl::address::nlas::Nla; use netlink_packet_route::rtnl::{AddressMessage, RtnlMessage}; -use netlink_packet_core::NetlinkPayload; use netlink_proto::Connection; use netlink_sys::{AsyncSocket, SocketAddr}; +use rtnetlink::constants::{RTMGRP_IPV4_IFADDR, RTMGRP_IPV6_IFADDR}; use std::collections::VecDeque; use std::future::Future; use std::io::{Error, ErrorKind, Result};