/* Discard data from a connection. Mostly used to discard wrong-sized messages. Returns 0 on success, logs a message and returns -1 on a network error.  */
static int rpcap_discard(SOCKET sock, uint32 len, char *errbuf)
/* Discard data from a connection. Mostly used to discard wrong-sized messages. Returns 0 on success, logs a message and returns -1 on a network error.  */
static int rpcap_discard(SOCKET sock, uint32 len, char *errbuf)
{
	if (len != 0)
	{
		if (sock_discard(sock, len, errbuf, PCAP_ERRBUF_SIZE) == -1)
		{
			return -1;
		}
	}
	return 0;
}