Files
moby/daemon/libnetwork/sandbox_windows.go
Paul Saab fadc29b86f libnetwork: send neighbor advertisements on restore
When the Docker daemon restarts with live-restore enabled, containers
retain their network namespaces but neighboring hosts may have stale
ARP/neighbor cache entries. This causes IPv6 connectivity issues because
unlike IPv4, where gratuitous ARP is sent on interface setup, IPv6
relies on Neighbor Discovery Protocol which requires explicit Neighbor
Advertisement messages to update caches.

This change adds unsolicited ARP (for IPv4) and Neighbor Advertisement
(for IPv6) messages when restoring interfaces after a daemon restart,
mirroring the behavior that already exists in AddInterface for new
containers.

The fix also handles network drivers (such as SR-IOV and macvlan) that
don't store the MAC address in the endpoint configuration by fetching
it from the actual link when needed.

Signed-off-by: Paul Saab <ps@mu.org>
2026-02-14 07:51:29 -08:00

54 lines
1.4 KiB
Go

package libnetwork
import (
"context"
"github.com/moby/moby/v2/daemon/libnetwork/osl"
"github.com/moby/moby/v2/errdefs"
)
func releaseOSSboxResources(*osl.Namespace, *Endpoint) {}
func (sb *Sandbox) updateGateway(_, _ *Endpoint) error {
// not implemented on Windows (Sandbox.osSbox is always nil)
return nil
}
func (sb *Sandbox) ExecFunc(func()) error {
// not implemented on Windows (Sandbox.osSbox is always nil)
return nil
}
func (sb *Sandbox) releaseOSSbox() error {
// not implemented on Windows (Sandbox.osSbox is always nil)
return nil
}
func (sb *Sandbox) restoreOslSandbox(_ context.Context) error {
// not implemented on Windows (Sandbox.osSbox is always nil)
return nil
}
// NetnsPath is not implemented on Windows (Sandbox.osSbox is always nil)
func (sb *Sandbox) NetnsPath() (path string, ok bool) {
return "", false
}
func (sb *Sandbox) canPopulateNetworkResources() bool {
return true
}
func (sb *Sandbox) populateNetworkResourcesOS(ctx context.Context, ep *Endpoint) error {
n := ep.getNetwork()
if err := addEpToResolver(ctx, n.Name(), ep.Name(), &sb.config, ep.iface, n.Resolvers()); err != nil {
return errdefs.System(err)
}
return nil
}
// IPv6Enabled always returns false on Windows as None of the Windows container
// network drivers currently support IPv6.
func (sb *Sandbox) IPv6Enabled() (enabled, ok bool) {
return false, true
}