mirror of https://github.com/jetkvm/kvm.git
delete then add addresses again
This commit is contained in:
parent
1ad44ed461
commit
9cd29a3b1b
|
|
@ -211,8 +211,7 @@ func (nm *NetlinkManager) EnsureInterfaceUpWithTimeout(ctx context.Context, ifac
|
||||||
case <-linkUpTimeout:
|
case <-linkUpTimeout:
|
||||||
attempt++
|
attempt++
|
||||||
l.Error().
|
l.Error().
|
||||||
Int("attempt", attempt).
|
Int("attempt", attempt).Msg("interface is still down after timeout")
|
||||||
Msg("interface is still down after timeout")
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
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)
|
actualToAdd := len(toAdd) - len(toUpdate)
|
||||||
if len(toAdd) > 0 || len(toUpdate) > 0 || len(toRemove) > 0 {
|
if len(toAdd) > 0 || len(toUpdate) > 0 || len(toRemove) > 0 {
|
||||||
nm.logger.Info().
|
nm.logger.Info().
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue