Fixed a couple of bugs in the udp protocol and in the function processing packets captured by libpcap.