diff --git a/internal/app/machined/pkg/controllers/network/operator/dhcp6.go b/internal/app/machined/pkg/controllers/network/operator/dhcp6.go index 958f7042d..227602d7b 100644 --- a/internal/app/machined/pkg/controllers/network/operator/dhcp6.go +++ b/internal/app/machined/pkg/controllers/network/operator/dhcp6.go @@ -145,7 +145,7 @@ func (d *DHCP6) TimeServerSpecs() []network.TimeServerSpecSpec { return d.timeservers } -func (d *DHCP6) parseReply(reply *dhcpv6.Message) { +func (d *DHCP6) parseReply(reply *dhcpv6.Message) (leaseTime time.Duration) { d.mu.Lock() defer d.mu.Unlock() @@ -165,6 +165,8 @@ func (d *DHCP6) parseReply(reply *dhcpv6.Message) { ConfigLayer: network.ConfigOperator, }, } + + leaseTime = reply.Options.OneIANA().Options.OneAddress().ValidLifetime } else { d.addresses = nil } @@ -215,6 +217,8 @@ func (d *DHCP6) parseReply(reply *dhcpv6.Message) { } else { d.timeservers = nil } + + return leaseTime } func (d *DHCP6) renew(ctx context.Context) (time.Duration, error) { @@ -243,9 +247,7 @@ func (d *DHCP6) renew(ctx context.Context) (time.Duration, error) { d.logger.Debug("DHCP6 REPLY", zap.String("link", d.linkName), zap.String("dhcp", collapseSummary(reply.Summary()))) - d.parseReply(reply) - - return reply.Options.OneIANA().Options.OneAddress().ValidLifetime, nil + return d.parseReply(reply), nil } func (d *DHCP6) waitIPv6LinkReady(ctx context.Context, iface *net.Interface) error {