Skip to content

Commit ee15153

Browse files
authored
Alias DLT_RAW_ALT -> DLT_RAW in compile_filter (secdev#4677)
1 parent d208e0a commit ee15153

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scapy/arch/common.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import socket
1313

1414
from scapy.config import conf
15-
from scapy.data import MTU, ARPHRD_TO_DLT
15+
from scapy.data import MTU, ARPHRD_TO_DLT, DLT_RAW_ALT, DLT_RAW
1616
from scapy.error import Scapy_Exception, warning
1717
from scapy.interfaces import network_name, resolve_iface, NetworkInterface
1818
from scapy.libs.structures import bpf_program
@@ -106,6 +106,9 @@ def compile_filter(filter_exp, # type: str
106106
# Failed to use linktype: use the interface
107107
pass
108108
if linktype is not None:
109+
# Some conversion aliases (e.g. linktype_to_dlt in libpcap)
110+
if linktype == DLT_RAW_ALT:
111+
linktype = DLT_RAW
109112
ret = pcap_compile_nopcap(
110113
MTU, linktype, ctypes.byref(bpf), bpf_filter, 1, -1
111114
)

0 commit comments

Comments
 (0)