Skip to content

Commit

Permalink
client: client ipv6 zone
Browse files Browse the repository at this point in the history
  • Loading branch information
schzhn committed Apr 10, 2024
1 parent 6f36ebc commit e9c1cbb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions internal/client/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/client/persistent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit e9c1cbb

Please sign in to comment.