Skip to content

Commit

Permalink
blocks/net: ignore zone id in ipv6
Browse files Browse the repository at this point in the history
Fixes #2080
  • Loading branch information
MaxVerevkin committed Aug 24, 2024
1 parent 7df3b8e commit 433d2e0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/netlink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,11 @@ async fn read_nameservers() -> Result<Vec<IpAddr>> {
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")?);
}
}
Expand Down

0 comments on commit 433d2e0

Please sign in to comment.