mirror of
https://github.com/clearlinux/libnetwork.git
synced 2026-09-07 22:31:49 +00:00
Cleaning up iptables nat table on driver bootup
This is required to have consistent behaviour as in 1.6.2. Signed-off-by: Madhu Venugopal <madhu@docker.com> Conflicts: drivers/bridge/bridge.go
This commit is contained in:
committed by
Arnaud Porterie
parent
e578e95aa1
commit
c32ef60c4b
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/docker/libnetwork/driverapi"
|
||||
"github.com/docker/libnetwork/ipallocator"
|
||||
"github.com/docker/libnetwork/iptables"
|
||||
"github.com/docker/libnetwork/netlabel"
|
||||
"github.com/docker/libnetwork/netutils"
|
||||
"github.com/docker/libnetwork/options"
|
||||
@@ -109,6 +110,9 @@ func Init(dc driverapi.DriverCallback) error {
|
||||
if out, err := exec.Command("modprobe", "-va", "bridge", "nf_nat", "br_netfilter").Output(); err != nil {
|
||||
logrus.Warnf("Running modprobe bridge nf_nat failed with message: %s, error: %v", out, err)
|
||||
}
|
||||
if err := iptables.RemoveExistingChain(DockerChain, iptables.Nat); err != nil {
|
||||
logrus.Warnf("Failed to remove existing iptables entries in %s : %v", DockerChain, err)
|
||||
}
|
||||
|
||||
return dc.RegisterDriver(networkType, newDriver())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user