diff --git a/lib/oxide-vpc/src/api.rs b/lib/oxide-vpc/src/api.rs index 1ddbb95d..8f146f83 100644 --- a/lib/oxide-vpc/src/api.rs +++ b/lib/oxide-vpc/src/api.rs @@ -305,7 +305,7 @@ pub struct TunnelEndpoint { impl PartialOrd for TunnelEndpoint { fn partial_cmp(&self, other: &Self) -> Option { - Some(self.ip.cmp(&other.ip)) + Some(self.cmp(other)) } } diff --git a/lib/oxide-vpc/src/engine/overlay.rs b/lib/oxide-vpc/src/engine/overlay.rs index d4651570..b0c1f014 100644 --- a/lib/oxide-vpc/src/engine/overlay.rs +++ b/lib/oxide-vpc/src/engine/overlay.rs @@ -257,7 +257,7 @@ impl StaticAction for EncapAction { None => return Ok(AllowOrDeny::Deny), }; PhysNet { - ether: MacAddr::from(INTERNET_GATEWAY_MAC), + ether: MacAddr::from(TUNNEL_ENDPOINT_MAC), ip: target.ip, vni: target.vni, } @@ -559,7 +559,7 @@ pub struct Virt2Boundary { } pub const BOUNDARY_SERVICES_VNI: u32 = 99u32; -pub const INTERNET_GATEWAY_MAC: [u8; 6] = [0xA8, 0x40, 0x25, 0x77, 0x77, 0x77]; +pub const TUNNEL_ENDPOINT_MAC: [u8; 6] = [0xA8, 0x40, 0x25, 0x77, 0x77, 0x77]; impl Virt2Boundary { pub fn dump_ip4(&self) -> Vec<(Ipv4Cidr, BTreeSet)> { diff --git a/lib/oxide-vpc/src/engine/print.rs b/lib/oxide-vpc/src/engine/print.rs index 13d3f32f..67b429bf 100644 --- a/lib/oxide-vpc/src/engine/print.rs +++ b/lib/oxide-vpc/src/engine/print.rs @@ -14,18 +14,11 @@ use crate::api::Ipv4Addr; use crate::api::Ipv6Addr; use crate::engine::overlay::DumpVirt2BoundaryResp; use crate::engine::overlay::DumpVirt2PhysResp; +use alloc::string::ToString; use opte::api::IpCidr; use opte::engine::geneve::Vni; use opte::engine::print::*; -cfg_if::cfg_if! { - if #[cfg(all(not(feature = "std"), not(test)))] { - use alloc::string::ToString; - } else { - use std::string::ToString; - } -} - /// Print the header for the [`print_v2p()`] output. fn print_v2p_header() { println!("{:<24} {:<17} UNDERLAY IP", "VPC IP", "VPC MAC ADDR"); diff --git a/lib/oxide-vpc/tests/common/mod.rs b/lib/oxide-vpc/tests/common/mod.rs index 760cb9a9..5b10c2bc 100644 --- a/lib/oxide-vpc/tests/common/mod.rs +++ b/lib/oxide-vpc/tests/common/mod.rs @@ -74,7 +74,7 @@ pub use oxide_vpc::engine::overlay::Virt2Boundary; pub use oxide_vpc::engine::overlay::Virt2Phys; pub use oxide_vpc::engine::overlay::VpcMappings; use oxide_vpc::engine::overlay::BOUNDARY_SERVICES_VNI; -pub use oxide_vpc::engine::overlay::INTERNET_GATEWAY_MAC; +use oxide_vpc::engine::overlay::TUNNEL_ENDPOINT_MAC; pub use oxide_vpc::engine::router; pub use oxide_vpc::engine::VpcNetwork; pub use oxide_vpc::engine::VpcParser; @@ -89,7 +89,7 @@ pub use std::sync::Arc; pub const VPC_LAYERS: [&str; 5] = ["gateway", "firewall", "router", "nat", "overlay"]; -pub const BS_MAC_ADDR: MacAddr = MacAddr::from_const(INTERNET_GATEWAY_MAC); +pub const BS_MAC_ADDR: MacAddr = MacAddr::from_const(TUNNEL_ENDPOINT_MAC); pub const BS_IP_ADDR: Ipv6Addr = Ipv6Addr::from_const([0xfd00, 0x99, 0, 0, 0, 0, 0, 1]); diff --git a/xde/src/xde.rs b/xde/src/xde.rs index a80f1fab..d2446795 100644 --- a/xde/src/xde.rs +++ b/xde/src/xde.rs @@ -10,7 +10,7 @@ //! interface, allowing one to run network implementations written in //! the OPTE framework. -#![allow(clippy::arc_with_non_send_sync)] +//#![allow(clippy::arc_with_non_send_sync)] use crate::dls; use crate::ioctl::IoctlEnvelope;