X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=djbdns%2Fcommon.py;h=138101141d12339640854684adc258ca5a803a12;hb=d9f3e6ef07662990538a9a6fb46f8120ffc37ee5;hp=6ef4e1ceae89ab6cea39b69330b4196a8e3ff892;hpb=c965f2fea1788a7faba2c67a4f05c27d5c34373b;p=djbdns-logparse.git diff --git a/djbdns/common.py b/djbdns/common.py index 6ef4e1c..1381011 100644 --- a/djbdns/common.py +++ b/djbdns/common.py @@ -67,6 +67,6 @@ def convert_ip(ip : str) -> str: if len(ip) == 8: # IPv4, eg. "7f000001" -> "7f 00 00 01" -> "127.0.0.1" return ".".join(map(str, pack(">L", int(ip, 16)))) - elif len(ip) == 32: - # IPv6 is actually simpler -- it's just a string-slicing operation. - return ":".join([ip[(4*i) : (4*i+4)] for i in range(8)]) + + # IPv6 is actually simpler -- it's just a string-slicing operation. + return ":".join([ip[(4*i) : (4*i+4)] for i in range(8)])