Fix IPv6 in ACLs (#1339)

This commit is contained in:
Kristoffer Dalby 2023-04-16 12:26:35 +02:00 committed by GitHub
parent 9836b097a4
commit 5e74ca9414
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 816 additions and 208 deletions

View file

@ -1267,3 +1267,17 @@ func (h *Headscale) GenerateGivenName(machineKey string, suppliedName string) (s
return givenName, nil
}
func (machines Machines) FilterByIP(ip netip.Addr) Machines {
found := make(Machines, 0)
for _, machine := range machines {
for _, mIP := range machine.IPAddresses {
if ip == mIP {
found = append(found, machine)
}
}
}
return found
}