mirror of
https://mirror.suhoan.cn/https://github.com/EasyTier/EasyTier.git
synced 2025-12-14 13:47:24 +08:00
allow use ipv4 address in any cidr (#404)
This commit is contained in:
@@ -130,7 +130,7 @@ pub fn enable_log() {
|
||||
fn check_route(ipv4: &str, dst_peer_id: PeerId, routes: Vec<crate::proto::cli::Route>) {
|
||||
let mut found = false;
|
||||
for r in routes.iter() {
|
||||
if r.ipv4_addr == ipv4.to_string() {
|
||||
if r.ipv4_addr == Some(ipv4.parse().unwrap()) {
|
||||
found = true;
|
||||
assert_eq!(r.peer_id, dst_peer_id, "{:?}", routes);
|
||||
}
|
||||
@@ -154,7 +154,7 @@ async fn wait_proxy_route_appear(
|
||||
let r = r;
|
||||
if r.proxy_cidrs.contains(&proxy_cidr.to_owned()) {
|
||||
assert_eq!(r.peer_id, dst_peer_id);
|
||||
assert_eq!(r.ipv4_addr, ipv4);
|
||||
assert_eq!(r.ipv4_addr, Some(ipv4.parse().unwrap()));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,13 +184,13 @@ pub async fn basic_three_node_test(#[values("tcp", "udp", "wg", "ws", "wss")] pr
|
||||
let insts = init_three_node(proto).await;
|
||||
|
||||
check_route(
|
||||
"10.144.144.2",
|
||||
"10.144.144.2/24",
|
||||
insts[1].peer_id(),
|
||||
insts[0].get_peer_manager().list_routes().await,
|
||||
);
|
||||
|
||||
check_route(
|
||||
"10.144.144.3",
|
||||
"10.144.144.3/24",
|
||||
insts[2].peer_id(),
|
||||
insts[0].get_peer_manager().list_routes().await,
|
||||
);
|
||||
@@ -357,7 +357,7 @@ pub async fn subnet_proxy_three_node_test(
|
||||
|
||||
wait_proxy_route_appear(
|
||||
&insts[0].get_peer_manager(),
|
||||
"10.144.144.3",
|
||||
"10.144.144.3/24",
|
||||
insts[2].peer_id(),
|
||||
"10.1.2.0/24",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user