From 433d2e0fbd9bfcb6de02c84f0eed3a24345d6181 Mon Sep 17 00:00:00 2001 From: MaxVerevkin Date: Sat, 24 Aug 2024 23:47:54 +0300 Subject: [PATCH] blocks/net: ignore zone id in ipv6 Fixes #2080 --- src/netlink.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/netlink.rs b/src/netlink.rs index b8557dbff6..906b21a04d 100644 --- a/src/netlink.rs +++ b/src/netlink.rs @@ -442,7 +442,11 @@ async fn read_nameservers() -> Result> { for line in file.lines() { let mut line_parts = line.split_whitespace(); if line_parts.next() == Some("nameserver") { - if let Some(ip) = line_parts.next() { + if let Some(mut ip) = line_parts.next() { + // TODO: use the zone id somehow? + if let Some((without_zone_id, _zone_id)) = ip.split_once('%') { + ip = without_zone_id; + } nameservers.push(ip.parse().error("Unable to parse ip")?); } }