mirror of
https://github.com/moby/moby.git
synced 2026-08-08 09:01:44 +00:00
bridge: Reapply endpoint iptables rules on firewalld reload
Signed-off-by: Andrey Epifanov <aepifanov@mirantis.com>
(cherry picked from commit 07393071ad)
Signed-off-by: Rob Murray <rob.murray@docker.com>
This commit is contained in:
committed by
Rob Murray
parent
29ed80aa86
commit
3e9ff78b94
@@ -792,11 +792,20 @@ func releasePortBindings(pbs []portBinding, fwn firewaller.Network) error {
|
||||
func (n *bridgeNetwork) reapplyPerPortIptables() {
|
||||
n.Lock()
|
||||
var allPBs []portBinding
|
||||
var allEPs []*bridgeEndpoint
|
||||
for _, ep := range n.endpoints {
|
||||
allPBs = append(allPBs, ep.portMapping...)
|
||||
allEPs = append(allEPs, ep)
|
||||
}
|
||||
n.Unlock()
|
||||
|
||||
for _, ep := range allEPs {
|
||||
netip4, netip6 := ep.netipAddrs()
|
||||
if err := n.firewallerNetwork.AddEndpoint(context.TODO(), netip4, netip6); err != nil {
|
||||
log.G(context.TODO()).Warnf("Failed to reconfigure Endpoint: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := n.firewallerNetwork.AddPorts(context.Background(), mergeChildHostIPs(allPBs)); err != nil {
|
||||
log.G(context.TODO()).Warnf("Failed to reconfigure NAT: %s", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user