Turn ipv6 representation of ipv4 addresses to simple ips for incoming connections
This commit is contained in:
parent
7c97e37dc3
commit
30b71328b9
1 changed files with 4 additions and 1 deletions
|
@ -131,7 +131,10 @@ class ConnectionServer(object):
|
|||
self.stream_server.stop()
|
||||
|
||||
def handleIncomingConnection(self, sock, addr):
|
||||
ip, port = addr
|
||||
ip, port = addr[0:2]
|
||||
ip = ip.lower()
|
||||
if ip.startswith("::ffff:"): # IPv6 to IPv4 mapping
|
||||
ip = ip.replace("::ffff:", "", 1)
|
||||
self.num_incoming += 1
|
||||
|
||||
# Connection flood protection
|
||||
|
|
Loading…
Reference in a new issue