From 9cd29a3b1b03f029f04aca34d820d1380027ae03 Mon Sep 17 00:00:00 2001 From: Siyuan Date: Fri, 10 Oct 2025 14:56:31 +0000 Subject: [PATCH] delete then add addresses again --- pkg/nmlite/link/manager.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/nmlite/link/manager.go b/pkg/nmlite/link/manager.go index 2f1bc8b6..c9b9410c 100644 --- a/pkg/nmlite/link/manager.go +++ b/pkg/nmlite/link/manager.go @@ -211,8 +211,7 @@ func (nm *NetlinkManager) EnsureInterfaceUpWithTimeout(ctx context.Context, ifac case <-linkUpTimeout: attempt++ l.Error(). - Int("attempt", attempt). - Msg("interface is still down after timeout") + Int("attempt", attempt).Msg("interface is still down after timeout") if err != nil { return nil, err } @@ -521,6 +520,13 @@ func (nm *NetlinkManager) ReconcileLink(link *Link, expected []types.IPAddress, } } + for _, addr := range toAdd { + netlinkAddr := addr.NetlinkAddr() + if err := nm.AddrAdd(link, &netlinkAddr); err != nil { + nm.logger.Warn().Err(err).Str("address", addr.Address.String()).Msg("failed to add address") + } + } + actualToAdd := len(toAdd) - len(toUpdate) if len(toAdd) > 0 || len(toUpdate) > 0 || len(toRemove) > 0 { nm.logger.Info().