Fixed minor parsing issue in FindIP

This commit is contained in:
lgandx 2025-05-22 18:45:45 -03:00
parent fa2b8dd5fd
commit 398a1fce31

View file

@ -240,8 +240,9 @@ def ParseSrcDSTAddr(data):
def FindIP(data): def FindIP(data):
IPPos = data.find(b"\x32\x04") + 2 IPPos = data.find(b"\x32\x04") + 2
if IPPos == -1 or IPPos + 4 >= len(data): if IPPos == -1 or IPPos + 4 >= len(data) or IPPos == 1:
return None #Probably not present in the DHCP options we received, let's grab it from the IP header instead
return data[12:16]
else: else:
IP = data[IPPos:IPPos+4] IP = data[IPPos:IPPos+4]
return IP return IP