Skip to content

Commit 0f9a6bf

Browse files
committed
test(network): respect hard-blocked host gateways
Signed-off-by: John Myers <[email protected]>
1 parent 344a2eb commit 0f9a6bf

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

‎e2e/rust/tests/proxy_egress_pipeline.rs‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,10 +1224,21 @@ async fn explicit_allowed_ips_and_implicit_ip_literals_succeed_through_both_adap
12241224
.lines()
12251225
.find_map(|line| line.trim().strip_prefix("GATEWAY_IP="))
12261226
.expect("sandbox gateway IPv4 output")
1227-
.to_string();
1228-
gateway_ip
12291227
.parse::<std::net::Ipv4Addr>()
1230-
.expect("host gateway must resolve to IPv4 for this Docker e2e");
1228+
.expect("host gateway must resolve to IPv4 for this e2e");
1229+
1230+
// Rootless Podman with pasta exposes its trusted host-gateway alias as a
1231+
// link-local address. The hostname receives a narrow runtime exemption,
1232+
// but the equivalent raw IP literal must remain hard-blocked. Other
1233+
// drivers still exercise the successful IP-literal path below.
1234+
if gateway_ip.is_loopback() || gateway_ip.is_link_local() || gateway_ip.is_unspecified() {
1235+
eprintln!(
1236+
"skipping IP-literal success assertions: host gateway {gateway_ip} is always blocked"
1237+
);
1238+
return;
1239+
}
1240+
1241+
let gateway_ip = gateway_ip.to_string();
12311242

12321243
let explicit_server = KeepAliveHttpServer::start()
12331244
.await

0 commit comments

Comments
 (0)