mirror of
https://github.com/Telmate/proxmox-api-go.git
synced 2026-04-26 07:55:50 +03:00
[GH-ISSUE #111] Link local IPv6 address can not be parsed for Windows VMs #20
Labels
No labels
good first issue
issue/confirmed
issue/critical
proposal/accepted
pull-request
type/bug
type/enhancement
type/feature
type/question
type/refactoring
type/testing
type/testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/proxmox-api-go#20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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])