Skip to content

Commit 8db595c

Browse files
author
Arko Dasgupta
committed
Revert "Merge pull request #2339 from phyber/iptables-check"
This reverts commit 820deef, reversing changes made to 19e372a. Signed-off-by: Arko Dasgupta <[email protected]>
1 parent 3e10ae9 commit 8db595c

File tree

1 file changed

+2
-32
lines changed

1 file changed

+2
-32
lines changed

firewall_linux.go

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,22 @@ package libnetwork
22

33
import (
44
"github.com/docker/libnetwork/iptables"
5-
"github.com/docker/libnetwork/netlabel"
65
"github.com/sirupsen/logrus"
76
)
87

98
const userChain = "DOCKER-USER"
109

1110
func (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.

0 commit comments

Comments
 (0)