mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
lock port mapper when reapply iptables rules
Make sure that port mapper state is not updated while we are trying to remap everything. Signed-off-by: Daniel Dao <dqminh@cloudflare.com>
This commit is contained in:
parent
7f15aee70e
commit
44cb162f3d
1 changed files with 2 additions and 0 deletions
|
@ -188,6 +188,8 @@ func (pm *PortMapper) Unmap(host net.Addr) error {
|
|||
|
||||
//ReMapAll will re-apply all port mappings
|
||||
func (pm *PortMapper) ReMapAll() {
|
||||
pm.lock.Lock()
|
||||
defer pm.lock.Unlock()
|
||||
logrus.Debugln("Re-applying all port mappings.")
|
||||
for _, data := range pm.currentMappings {
|
||||
containerIP, containerPort := getIPAndPort(data.container)
|
||||
|
|
Loading…
Add table
Reference in a new issue