mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
Make RFC1918 listener spawning opt-in via --rfc1918 flag instead of automatic behavior. This allows users to explicitly control when ctrld listens on private network addresses to receive DNS queries from LAN clients, improving security and configurability. Refactor network interface detection to better distinguish between physical and virtual interfaces, ensuring only real hardware interfaces are used for RFC1918 address binding.
16 lines
406 B
Go
16 lines
406 B
Go
//go:build !darwin && !windows && !linux
|
|
|
|
package ctrld
|
|
|
|
import "tailscale.com/net/netmon"
|
|
|
|
// validInterfaces returns a set containing only default route interfaces.
|
|
// TODO: deuplicated with cmd/cli/net_others.go in v2.
|
|
func validInterfaces() map[string]struct{} {
|
|
defaultRoute, err := netmon.DefaultRoute()
|
|
if err != nil {
|
|
return nil
|
|
}
|
|
return map[string]struct{}{defaultRoute.InterfaceName: {}}
|
|
}
|