Return fake IP even when there is no conn

This commit is contained in:
Alexander Simmerl
2018-05-21 17:55:40 +02:00
parent 7b02b5b66b
commit 20e9dd0737
+1 -1
View File
@@ -56,7 +56,7 @@ func (pc peerConn) RemoteIP() net.IP {
return pc.ips[0]
}
if pc.conn.RemoteAddr().String() == "pipe" {
if pc.conn == nil || pc.conn.RemoteAddr().String() == "pipe" {
pc.ips = []net.IP{
net.IP{172, 16, 0, byte(atomic.AddUint32(&testIPSuffix, 1))},
}