Skip to content

Commit

Permalink
Fix compile_filter on *BSD with non-ether linktypes
Browse files Browse the repository at this point in the history
  • Loading branch information
gpotter2 committed Feb 22, 2025
1 parent ef6da4b commit b194a7a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions scapy/arch/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import socket

from scapy.config import conf
from scapy.data import MTU, ARPHDR_ETHER, ARPHRD_TO_DLT
from scapy.data import MTU, ARPHRD_TO_DLT
from scapy.error import Scapy_Exception, warning
from scapy.interfaces import network_name, resolve_iface, NetworkInterface
from scapy.libs.structures import bpf_program
Expand Down Expand Up @@ -105,8 +105,6 @@ def compile_filter(filter_exp, # type: str
except Exception:
# Failed to use linktype: use the interface
pass
if not linktype and conf.use_bpf:
linktype = ARPHDR_ETHER
if linktype is not None:
ret = pcap_compile_nopcap(
MTU, linktype, ctypes.byref(bpf), bpf_filter, 1, -1
Expand Down

0 comments on commit b194a7a

Please sign in to comment.