[GH-ISSUE #111] Link local IPv6 address can not be parsed for Windows VMs #20

Closed
opened 2026-02-28 00:40:13 +03:00 by kerem · 0 comments
Owner

Originally created by @mmassez on GitHub (Mar 30, 2021).
Original GitHub issue: https://github.com/Telmate/proxmox-api-go/issues/111

When trying to retrieve the IPs from a Windows VM I get an error that the IP could not be parsed.
This has to do with the Qemu guest agent returning the link local IPv6 address with the interface name:
fe80::b955:5aab:62c1:a1f3%3

As such the IP address cannot be parsed. I added a simple fix to prevent this but not sure if it's the proper way to handle this.

Basically I added a split in the code where the IP addresses get parsed one by one. It splits on the % sign and returns only the first part. This makes the function parse the IPv6 correctly.
a.IPAddresses[idx] = net.ParseIP((strings.Split(ip.IPAddress, "%"))[0])

Originally created by @mmassez on GitHub (Mar 30, 2021). Original GitHub issue: https://github.com/Telmate/proxmox-api-go/issues/111 When trying to retrieve the IPs from a Windows VM I get an error that the IP could not be parsed. This has to do with the Qemu guest agent returning the link local IPv6 address with the interface name: fe80::b955:5aab:62c1:a1f3%3 As such the IP address cannot be parsed. I added a simple fix to prevent this but not sure if it's the proper way to handle this. Basically I added a split in the code where the IP addresses get parsed one by one. It splits on the % sign and returns only the first part. This makes the function parse the IPv6 correctly. a.IPAddresses[idx] = net.ParseIP((strings.Split(ip.IPAddress, "%"))[0])
kerem closed this issue 2026-02-28 00:40:13 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-api-go#20
No description provided.