fix pcap error handling