a5f45b47a3
These functions were mostly identical, except for iptables being enabled by default (unless explicitly disabled by config). Rewrite the function to a enabledIptablesVersions, which returns the list of iptables-versions that are enabled for the controller. This prevents having to acquire a lock twice, and simplifies arrangeUserFilterRule, which can now just iterate over the enabled versions. Also moving this function to a linux-only file, as other platforms don't have the iptables types defined. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
8 lines
168 B
Go
8 lines
168 B
Go
//go:build !linux
|
|
|
|
package libnetwork
|
|
|
|
// enabledIptablesVersions is a no-op on non-Linux systems.
|
|
func (c *Controller) enabledIptablesVersions() []any {
|
|
return nil
|
|
}
|