From 05649d48e6548bb31d1064439e0eaf94ba55c09d Mon Sep 17 00:00:00 2001 From: liuluyao Date: Thu, 19 Oct 2023 15:39:56 +0800 Subject: [PATCH] fix: sometime pcap_next returns 0 which lead to segment fault --- dpi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dpi.c b/dpi.c index 7407d25..41fb25c 100644 --- a/dpi.c +++ b/dpi.c @@ -213,6 +213,7 @@ void *xcap(void *v_dev_name) { while (runtime__xcap) { packet = pcap_next(handle, &header); + if(!packet) continue; ep = (struct ether_header *)packet; ether_type = ntohs(ep->ether_type); if (ether_type != ETHERTYPE_IP) {