From b824e8c98f3c30863f4051110aecc0b948d28032 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Sun, 29 Jul 2018 17:13:44 -0800 Subject: [PATCH] Preserve dhcp6 option --- net/netplan-lib.pl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/net/netplan-lib.pl b/net/netplan-lib.pl index b9dc8038a..0df2ce0bf 100644 --- a/net/netplan-lib.pl +++ b/net/netplan-lib.pl @@ -34,6 +34,11 @@ foreach my $f (glob("$netplan_dir/*.yaml")) { if (&is_true_value($dhcp)) { $cfg->{'dhcp'} = 1; } + my ($dhcp6) = grep { $_->{'name'} eq 'dhcp6' } + @{$e->{'members'}}; + if (&is_true_value($dhcp6)) { + $cfg->{'dhcp6'} = 1; + } # Is optional at boot? my ($optional) = grep { $_->{'name'} eq 'optional' } @@ -163,6 +168,9 @@ else { push(@addrs, $iface->{'address'}."/". &mask_to_prefix($iface->{'netmask'})); } + if ($iface->{'dhcp6'}) { + push(@lines, $id." "."dhcp6: true"); + } for(my $i=0; $i<@{$iface->{'address6'}}; $i++) { push(@addrs, $iface->{'address6'}->[$i]."/". $iface->{'netmask6'}->[$i]);