Fix UDP length parsing

This patch ensures that the stated UDP payload length is within the received buffer size and within the size indicated by the IP header. This fixes #172