fix(linux): don't fail on unsupported IP version (#7583)

Firezone always attempts to handle IPv4 and IPv6. On Linux systems
without an IPv6 stack, attempts to add an IPv6 route may fail with "Not
supported (os error 95)". We don't need the IPv6 routes on those systems
as we will never receive IPv6 traffic. Therefore, we can safely ignore
these errors and not log them.
This commit is contained in:
Thomas Eizinger
2024-12-25 12:09:22 +01:00
committed by GitHub
parent dc9d34cf84
commit e7cc0e5eef

View File

@@ -261,6 +261,11 @@ async fn add_route(route: &IpNetwork, idx: u32, handle: &Handle) {
return;
}
// On systems without support for a certain IP version (i.e. no IPv6), attempting to add a route may result in "Not supported (os error 95)".
if matches!(&err, NetlinkError(err) if err.raw_code() == -libc::EOPNOTSUPP) {
return;
}
tracing::warn!(error = std_dyn_err(&err), %route, "Failed to add route");
}