summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJoakim Hulthe <joakim.hulthe@mullvad.net>2025-02-11 15:36:55 +0100
committerJoakim Hulthe <joakim.hulthe@mullvad.net>2025-02-25 13:37:35 +0100
commitfbf32228e84997c1bb853bc047b07680167a48a2 (patch)
tree78e5323d874ebdd0025a6ab9de5eb98d37c19ae9
parent281018b91cd12d49af83cbfc3003b1dd08829d39 (diff)
downloadmullvadvpn-fbf32228e84997c1bb853bc047b07680167a48a2.tar.xz
mullvadvpn-fbf32228e84997c1bb853bc047b07680167a48a2.zip
Fix position of safety comment in talpid_routing::windows
-rw-r--r--talpid-routing/src/windows/get_best_default_route.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/talpid-routing/src/windows/get_best_default_route.rs b/talpid-routing/src/windows/get_best_default_route.rs
index 21dc6edd7b..798bc37285 100644
--- a/talpid-routing/src/windows/get_best_default_route.rs
+++ b/talpid-routing/src/windows/get_best_default_route.rs
@@ -153,10 +153,12 @@ struct AnnotatedRoute<'a> {
}
fn annotate_route(route: &MIB_IPFORWARD_ROW2) -> Option<AnnotatedRoute<'_>> {
- // SAFETY: `si_family` is valid in both `Ipv4` and `Ipv6` so we can safely access `si_family`.
let iface = get_ip_interface_entry(
- AddressFamily::try_from_af_family(unsafe { route.DestinationPrefix.Prefix.si_family })
- .ok()?,
+ AddressFamily::try_from_af_family(
+ // SAFETY: `si_family` is valid in both `Ipv4` and `Ipv6` so we can safely access `si_family`.
+ unsafe { route.DestinationPrefix.Prefix.si_family },
+ )
+ .ok()?,
&route.InterfaceLuid,
)
.ok()?;