From e9c1cbb85e4afa173969d5bedfaaaf92716b7fad Mon Sep 17 00:00:00 2001 From: Stanislav Chzhen Date: Wed, 10 Apr 2024 16:23:07 +0300 Subject: [PATCH] client: client ipv6 zone --- internal/client/index.go | 2 ++ internal/client/persistent.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/client/index.go b/internal/client/index.go index c6a17cb3703..a7f36c482c7 100644 --- a/internal/client/index.go +++ b/internal/client/index.go @@ -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 diff --git a/internal/client/persistent.go b/internal/client/persistent.go index 06e346f4dfc..8345f41896a 100644 --- a/internal/client/persistent.go +++ b/internal/client/persistent.go @@ -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 }