mirror of
https://github.com/moby/moby.git
synced 2026-08-09 01:21:37 +00:00
bridge: Reapply endpoint iptables rules on firewalld reload
Signed-off-by: Andrey Epifanov <aepifanov@mirantis.com>
This commit is contained in:
committed by
Cory Snider
parent
6d457d9695
commit
07393071ad
@@ -354,11 +354,20 @@ func (n *bridgeNetwork) unmapPBs(ctx context.Context, bindings []portmapperapi.P
|
||||
func (n *bridgeNetwork) reapplyPerPortIptables() {
|
||||
n.Lock()
|
||||
var allPBs []portmapperapi.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