Reload DOCKER-USER chain on frewalld reload.

Relates to moby/moby#35043

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff 2018-01-12 10:29:09 -05:00
parent f9a14ba9dc
commit d5fef4ca1c
3 changed files with 13 additions and 4 deletions

View File

@ -882,9 +882,7 @@ addToStore:
c.Unlock()
}
c.Lock()
arrangeUserFilterRule()
c.Unlock()
c.arrangeUserFilterRule()
return network, nil
}

View File

@ -7,6 +7,17 @@ import (
const userChain = "DOCKER-USER"
func (c *controller) arrangeUserFilterRule() {
c.Lock()
arrangeUserFilterRule()
c.Unlock()
iptables.OnReloaded(func() {
c.Lock()
arrangeUserFilterRule()
c.Unlock()
})
}
// This chain allow users to configure firewall policies in a way that persists
// docker operations/restarts. Docker will not delete or modify any pre-existing
// rules from the DOCKER-USER filter chain.

View File

@ -2,5 +2,5 @@
package libnetwork
func arrangeUserFilterRule() {
func (c *controller) arrangeUserFilterRule() {
}