fix(config): Rename "interface_filter" setting

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
Steffen Vogel
2025-03-18 08:03:50 +01:00
parent 6a65c49940
commit 598e18c3d9
5 changed files with 11 additions and 11 deletions

View File

@@ -312,10 +312,10 @@ ice:
# candidate_types: [host, srflx, prflx, relay]
# A glob(7) pattern to match interfaces against which are used to gather ICE candidates (e.g. \"eth[0-9]\").
interface_filter: "*"
interface_include: "*"
# A glob(7) pattern to match interfaces against which are ignored when gathering ICE candidates (e.g. \"tun[0-9]\").
ignore_interfaces: ""
interfaces_exclude: ""
# Lite agents do not perform connectivity check and only provide host candidates.
lite: false

View File

@@ -115,12 +115,12 @@ func (c *InterfaceSettings) AgentConfig(ctx context.Context, peer *crypto.Key) (
}
cfg.InterfaceFilter = func(name string) bool {
match, err := filepath.Match(c.ICE.InterfaceFilter, name)
match, err := filepath.Match(c.ICE.InterfacesInclude, name)
if err != nil {
return false
}
ignore, err := filepath.Match(c.ICE.IgnoreInterfaces, name)
ignore, err := filepath.Match(c.ICE.InterfacesExclude, name)
if err != nil {
return false
}

View File

@@ -68,8 +68,8 @@ var (
DisconnectedTimeout: 5 * time.Second,
FailedTimeout: 25 * time.Second,
RestartTimeout: 10 * time.Second,
InterfaceFilter: "*",
IgnoreInterfaces: "",
InterfacesInclude: "*",
InterfacesExclude: "",
KeepaliveInterval: 2 * time.Second,
MaxBindingRequests: 7,
PortRange: PortRangeSettings{

View File

@@ -38,8 +38,8 @@ type ICESettings struct {
MaxBindingRequests int `koanf:"max_binding_requests,omitempty"`
InsecureSkipVerify bool `koanf:"insecure_skip_verify,omitempty"`
InterfaceFilter string `koanf:"interface_filter,omitempty"`
IgnoreInterfaces string `koanf:"ignore_interfaces,omitempty"`
InterfacesInclude string `koanf:"interfaces_include,omitempty"`
InterfacesExclude string `koanf:"interfaces_exclude,omitempty"`
DisconnectedTimeout time.Duration `koanf:"disconnected_timeout,omitempty"`
FailedTimeout time.Duration `koanf:"failed_timeout,omitempty"`

View File

@@ -47,11 +47,11 @@ func (i *Interface) setupUDPMux() error {
}
ifFilter := func(name string) bool {
if match, err := filepath.Match(i.Settings.ICE.InterfaceFilter, name); err != nil {
if include, err := filepath.Match(i.Settings.ICE.InterfacesInclude, name); err != nil {
return false
} else if ignore, err := filepath.Match(i.Settings.ICE.IgnoreInterfaces, name); err != nil {
} else if exclude, err := filepath.Match(i.Settings.ICE.InterfacesExclude, name); err != nil {
return false
} else if !match || ignore {
} else if !include || exclude {
return false
}