-
Notifications
You must be signed in to change notification settings - Fork 103
IPv6 support for the proxmox builder. #319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -176,10 +176,15 @@ func getVMIP(state multistep.StateBag) (string, error) { | |
|
|
||
| for _, iface := range ifs { | ||
| for _, addr := range iface.IpAddresses { | ||
| if addr.IsLoopback() { | ||
| if addr.To4() == nil && addr.To16() == nil { | ||
| // no IPv4 or IPv6 at all | ||
| continue | ||
| } | ||
| if addr.To4() == nil { | ||
| } else if addr.IsLinkLocalUnicast() || addr.IsMulticast() || addr.IsLoopback() || addr.IsUnspecified() { | ||
| // can not be replaced by !addr.IsGlobalUnicast() because it just returns ips wich are globally routable, | ||
| // but Unique Local Addresses: fc00::/7 can be used as well for IPv6 setups. | ||
| // SiteLocalUnicast: fec0::/10 | ||
| // multicast: ff00::/8 | ||
| // LinkLocalUnicat: fe80::/64 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This changes the default communicator host selection from IPv4-only to the first usable IPv4 or IPv6 address. On dual-stack guests, that can silently switch existing builds to IPv6 if the guest agent reports it first. Can we preserve current behavior by preferring IPv4 and only falling back to IPv6 when no usable IPv4 exists? |
||
| continue | ||
| } | ||
| return addr.String(), nil | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add focused tests for the address selection behavior here? We should cover IPv4-only, IPv6-only, and dual-stack ordering so this change is pinned down before merge.