lib/relay: Correctly get IP from remote addr via proxy (fixes #3223)
Correctly handles addresses, and fixes one more panicing place. GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3230
This commit is contained in:
committed by
Audrius Butkevicius
parent
a775dd2b79
commit
4970bd7f65
@@ -122,8 +122,7 @@ func (c *staticClient) Serve() {
|
||||
case protocol.SessionInvitation:
|
||||
ip := net.IP(msg.Address)
|
||||
if len(ip) == 0 || ip.IsUnspecified() {
|
||||
ip := net.ParseIP(c.conn.RemoteAddr().String())
|
||||
msg.Address = ip[:]
|
||||
msg.Address = remoteIPBytes(c.conn)
|
||||
}
|
||||
c.invitations <- msg
|
||||
|
||||
|
||||
Reference in New Issue
Block a user