Skip to content

Commit

Permalink
Proper ignore IPv6 announcements when IPv6 is not requested
Browse files Browse the repository at this point in the history
  • Loading branch information
rikatz committed Jan 31, 2025
1 parent bdd2b91 commit 489b564
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/providers/vsphere/network/netplan.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ func NetPlanCustomization(result NetworkInterfaceResults) (*netplan.Network, err

npEth.Dhcp4 = &r.DHCP4
npEth.Dhcp6 = &r.DHCP6
// Right now we can set the same value as DHCPv6 configuration
// and in some future separate/specialize if required
npEth.AcceptRa = &r.DHCP6

if !*npEth.Dhcp4 {
for i := range r.IPConfigs {
Expand Down
2 changes: 2 additions & 0 deletions pkg/providers/vsphere/network/netplan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ var _ = Describe("Netplan", func() {
Expect(*np.SetName).To(Equal(guestDevName))
Expect(*np.Dhcp4).To(BeFalse())
Expect(*np.Dhcp6).To(BeFalse())
Expect(*np.AcceptRa).To(BeFalse())
Expect(np.Addresses).To(HaveLen(2))
Expect(np.Addresses[0]).To(Equal(netplan.Address{String: ptr.To(ipv4CIDR)}))
Expect(np.Addresses[1]).To(Equal(netplan.Address{String: ptr.To(ipv6 + fmt.Sprintf("/%d", ipv6Subnet))}))
Expand Down Expand Up @@ -142,6 +143,7 @@ var _ = Describe("Netplan", func() {
Expect(*np.SetName).To(Equal(guestDevName))
Expect(*np.Dhcp4).To(BeTrue())
Expect(*np.Dhcp6).To(BeTrue())
Expect(*np.AcceptRa).To(BeTrue())
Expect(*np.MTU).To(BeEquivalentTo(9000))
Expect(np.Nameservers.Addresses).To(Equal([]string{dnsServer1}))
Expect(np.Nameservers.Search).To(Equal([]string{searchDomain1}))
Expand Down

0 comments on commit 489b564

Please sign in to comment.