feat(machine): add ACLFilter if ACL's are enabled.

This commit change the default behaviour and remove the notion of namespaces between the hosts. It allows all namespaces to be only filtered by the ACLs. This behavior is closer to tailsnet.
This commit is contained in:
Adrien Raffin 2022-02-03 19:53:11 +01:00 committed by Adrien Raffin-Caboisse
parent 9b7d657cbe
commit e482dfeed4
No known key found for this signature in database
GPG key ID: 7FB60532DEBEAD6A
3 changed files with 183 additions and 43 deletions

View file

@ -212,6 +212,15 @@ func (h *Headscale) getUsedIPs() ([]netaddr.IP, error) {
return ips, nil
}
func containsString(ss []string, s string) bool {
for _, v := range ss {
if v == s {
return true
}
}
return false
}
func containsIPs(ips []netaddr.IP, ip netaddr.IP) bool {
for _, v := range ips {
if v == ip {