client: client ipv6 zone

This commit is contained in:
Stanislav Chzhen 2024-04-10 16:23:07 +03:00
parent 6f36ebc06c
commit e9c1cbb85e
2 changed files with 3 additions and 1 deletions

View File

@ -192,6 +192,8 @@ func (ci *Index) Find(id string) (c *Persistent, ok bool) {
// find finds persistent client by IP address.
func (ci *Index) findByIP(ip netip.Addr) (c *Persistent, found bool) {
ip = ip.WithZone("")
uid, found := ci.ipToUID[ip]
if found {
return ci.uidToClient[uid], true

View File

@ -161,7 +161,7 @@ func (c *Persistent) setID(id string) (err error) {
var ip netip.Addr
if ip, err = netip.ParseAddr(id); err == nil {
c.IPs = append(c.IPs, ip)
c.IPs = append(c.IPs, ip.WithZone(""))
return nil
}