chore: sync konduit-platform v0.1.0-beta.11

This commit is contained in:
E. Kaparulin
2026-07-25 18:00:40 +03:00
parent c2d7f8d8c6
commit 9780e4d1a1

View File

@@ -90,6 +90,14 @@ impl RouteManager {
// Collect all default-route gateways with their metrics.
// VPN default routes have low metric (50); physical/DHCP routes have high metric (600+).
// We want the physical gateway, so take the one with the highest metric.
//
// The metric comparison alone is not reliable: the kernel does not always
// round-trip the Priority attribute on route dumps (see the Oif-based match
// in suspend_default_route() below, which exists for the same reason), and a
// leftover default route on a reused tun ifindex from an imperfectly torn
// down previous session can win the metric comparison by accident. Since we
// already know our own tun interface's index at this point, exclude it
// outright rather than trusting metric alone to steer around it.
let mut candidates: Vec<(u32, Ipv4Addr, u32)> = Vec::new();
while let Some(route) = routes.try_next().await? {
@@ -110,6 +118,9 @@ impl RouteManager {
}
}
if let (Some(gw), Some(idx)) = (gateway, oif) {
if Some(idx) == self.tun_index {
continue;
}
candidates.push((metric, gw, idx));
}
}