Skip to content

Commit

Permalink
Merge pull request moby#48609 from robmry/nodad_bridge_address
Browse files Browse the repository at this point in the history
Set NODAD on bridge IPv6 addresses
  • Loading branch information
thaJeztah authored Oct 8, 2024
2 parents 367c910 + 38f0483 commit 16154dc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libnetwork/drivers/bridge/interface_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"net"
"net/netip"
"syscall"

"github.com/containerd/log"
"github.com/docker/docker/errdefs"
Expand Down Expand Up @@ -134,7 +135,10 @@ func (i *bridgeInterface) programIPv6Addresses(config *networkConfiguration) err
// doesn't update the prefix length. This is a cosmetic problem, the prefix
// length of an assigned address is not used to determine whether an address is
// "on-link" (RFC-5942).
if err := i.nlh.AddrReplace(i.Link, &netlink.Addr{IPNet: netiputil.ToIPNet(addrPrefix)}); err != nil {
if err := i.nlh.AddrReplace(i.Link, &netlink.Addr{
IPNet: netiputil.ToIPNet(addrPrefix),
Flags: syscall.IFA_F_NODAD,
}); err != nil {
return errdefs.System(fmt.Errorf("failed to add IPv6 address %s to bridge: %v", i.bridgeIPv6, err))
}
return nil
Expand Down

0 comments on commit 16154dc

Please sign in to comment.