[roads] QA F-08: a mesh address is never an internet address

devices.address refused only special and IPv4-embedding ranges, so a public
address was accepted, and an exit's forward-to-internet rule then covered that
device's mesh address. Mesh addresses now stay inside the not-internet ranges
(100.64.0.0/10, RFC 1918, ULA). Two fixtures, IPv4 and IPv6.
This commit is contained in:
2026-11-25 08:50:23 +01:00
parent 31a46d0367
commit ff78361165
6 changed files with 45 additions and 4 deletions
+8 -2
View File
@@ -395,10 +395,13 @@ impl Devices {
},
};
let address = match d.address.parse::<std::net::IpAddr>() {
// A mesh address is never an internet address, so an exit's `internet` rule can never
// cover another device of the mesh (QA F-08).
Ok(a)
if a.to_string() == d.address
&& !Net::host(a).is_special()
&& !Net::host(a).embeds_ipv4() =>
&& !Net::host(a).embeds_ipv4()
&& !Net::host(a).reaches_internet() =>
{
if !addresses.insert(a) {
e(
@@ -413,7 +416,10 @@ impl Devices {
e(
f("address"),
r::DEVICES_ADDRESS,
format!("`{}` is not one IP address", clip(&d.address)),
format!(
"`{}` is not one private IP address (a mesh address is never loopback, link-local, multicast, embedded IPv4 or on the internet; 100.64.0.0/10 or a ULA)",
clip(&d.address)
),
);
None
}