Skip to content

Commit

Permalink
Merge pull request #788 from rikatz/pass-accept-ra-to-cloudinit
Browse files Browse the repository at this point in the history
🐛 Ignore IPv6 Route advertisement in case DHCPv6 wasn't requested
  • Loading branch information
akutz authored Feb 3, 2025
2 parents bdd2b91 + 489b564 commit b597f5f
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 b597f5f

Please sign in to comment.