I am running a server application on a PC which receives UDP packets from a client. The UDP packets are received (verified in WireShark), but include the wrong checksum. I have no control over the client and need to be able to receive these packets in Python. The following code doesn’t see the packets:
UDPSock = socket(AF_INET,SOCK_DGRAM)
UDPSock.bind(addr)
while 1:
data,addr = UDPSock.recvfrom(buf)
if not data:
print "Client has exited!"
break
else:
print "\nReceived message '", data,"'"
UDPSock.close()
Anyway in Python I can receive malformed UDP packets?
Found the solution.
I used the pycap library in combination with dpkt. The pycap module is outdated, for older versions of Python, but in the “Issues” someone posted updated binaries.