From 874ad762eab966d4dc5a2960b4687553c3dd324e Mon Sep 17 00:00:00 2001 From: Dave luo Date: Sun, 8 Oct 2023 12:34:18 -0500 Subject: [PATCH] fix: filter UDP packet --- pcaper/pcaper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pcaper/pcaper.py b/pcaper/pcaper.py index 54a285b..4145fc9 100644 --- a/pcaper/pcaper.py +++ b/pcaper/pcaper.py @@ -12,6 +12,7 @@ from __future__ import unicode_literals import dpkt +from dpkt.udp import UDP import socket from dpkt.compat import BytesIO import re @@ -457,6 +458,8 @@ def read_pcap(self, params): ip_packet = eth_packet.data if not hasattr(ip_packet, 'data'): continue + if isinstance(ip_packet.data, UDP): + continue tcp_packet = ip_packet.data if not hasattr(tcp_packet, 'data'): continue