From d576bdfa14ef666bb61e0f5726b8d45d28fe2aeb Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 26 Dec 2023 19:13:30 +0200 Subject: [PATCH] add IPv6 support --- server_entry.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server_entry.py b/server_entry.py index 7a31dc0..d26160f 100644 --- a/server_entry.py +++ b/server_entry.py @@ -67,8 +67,7 @@ class ServerEntry: self.addr = addr # Shortcuts for generating query self.queryAddr = b'' - for i in addr[0].split('.'): - self.queryAddr += pack('!B', int(i)) + self.queryAddr += ipaddress.ip_address(addr[0]).packed self.queryAddr += pack('!H', int(addr[1])) # Random number that server must return