Skip to content

Commit f2e1f52

Browse files
committed
Try to load kernel module ip6_tables, when necessary.
Signed-off-by: Rob Murray <[email protected]>
1 parent 4740820 commit f2e1f52

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

libnetwork/drivers/bridge/bridge_linux.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
"github.com/containerd/log"
1212
"github.com/docker/docker/errdefs"
13+
"github.com/docker/docker/internal/modprobe"
1314
"github.com/docker/docker/internal/nlwrap"
1415
"github.com/docker/docker/libnetwork/datastore"
1516
"github.com/docker/docker/libnetwork/driverapi"
@@ -553,6 +554,14 @@ func (d *driver) configure(option map[string]interface{}) error {
553554
}
554555

555556
if config.EnableIP6Tables {
557+
if err := modprobe.LoadModules(context.TODO(), func() error {
558+
iptable := iptables.GetIptable(iptables.IPv6)
559+
_, err := iptable.Raw("-t", "filter", "-n", "-L", "FORWARD")
560+
return err
561+
}, "ip6_tables"); err != nil {
562+
log.G(context.TODO()).WithError(err).Debug("Loading ip6_tables")
563+
}
564+
556565
removeIPChains(iptables.IPv6)
557566

558567
if err := setupHashNetIpset(ipsetExtBridges6, unix.AF_INET6); err != nil {

0 commit comments

Comments
 (0)