Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rcgoodfellow committed Jan 15, 2024
1 parent 73d4669 commit 3739ce6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/oxide-vpc/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ pub struct TunnelEndpoint {

impl PartialOrd for TunnelEndpoint {
fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> {
Some(self.ip.cmp(&other.ip))
Some(self.cmp(other))
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/oxide-vpc/src/engine/overlay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down Expand Up @@ -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<TunnelEndpoint>)> {
Expand Down
9 changes: 1 addition & 8 deletions lib/oxide-vpc/src/engine/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions lib/oxide-vpc/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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]);
Expand Down
2 changes: 1 addition & 1 deletion xde/src/xde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3739ce6

Please sign in to comment.