File tree Expand file tree Collapse file tree 1 file changed +2
-32
lines changed Expand file tree Collapse file tree 1 file changed +2
-32
lines changed Original file line number Diff line number Diff line change @@ -2,52 +2,22 @@ package libnetwork
22
33import (
44 "github.com/docker/libnetwork/iptables"
5- "github.com/docker/libnetwork/netlabel"
65 "github.com/sirupsen/logrus"
76)
87
98const userChain = "DOCKER-USER"
109
1110func (c * controller ) arrangeUserFilterRule () {
1211 c .Lock ()
13-
14- if c .hasIPTablesEnabled () {
15- arrangeUserFilterRule ()
16- }
17-
12+ arrangeUserFilterRule ()
1813 c .Unlock ()
19-
2014 iptables .OnReloaded (func () {
2115 c .Lock ()
22-
23- if c .hasIPTablesEnabled () {
24- arrangeUserFilterRule ()
25- }
26-
16+ arrangeUserFilterRule ()
2717 c .Unlock ()
2818 })
2919}
3020
31- func (c * controller ) hasIPTablesEnabled () bool {
32- // Locking c should be handled in the calling method.
33- if c .cfg == nil || c .cfg .Daemon .DriverCfg [netlabel .GenericData ] == nil {
34- return false
35- }
36-
37- genericData , ok := c .cfg .Daemon .DriverCfg [netlabel .GenericData ]
38- if ! ok {
39- return false
40- }
41-
42- optMap := genericData .(map [string ]interface {})
43- enabled , ok := optMap ["EnableIPTables" ].(bool )
44- if ! ok {
45- return false
46- }
47-
48- return enabled
49- }
50-
5121// This chain allow users to configure firewall policies in a way that persists
5222// docker operations/restarts. Docker will not delete or modify any pre-existing
5323// rules from the DOCKER-USER filter chain.
You can’t perform that action at this time.
0 commit comments