diff --git a/scapy/arch/bpf/pfroute.py b/scapy/arch/bpf/pfroute.py index 28eb59a5ba3..e81c2b504eb 100644 --- a/scapy/arch/bpf/pfroute.py +++ b/scapy/arch/bpf/pfroute.py @@ -1234,11 +1234,13 @@ def _get_if_list(): ifindex = msg.ifm_index ifname = None mac = "00:00:00:00:00:00" + itype = -1 ifflags = msg.ifm_flags ips = [] for addr in msg.addrs: if addr.sa_family == socket.AF_LINK: ifname = addr.sdl_iface.decode() + itype = addr.sdl_type if addr.sdl_addr: mac = addr.sdl_addr if ifname is not None: @@ -1250,5 +1252,6 @@ def _get_if_list(): "flags": ifflags, "mac": mac, "ips": ips, + "type": itype, } return interfaces diff --git a/scapy/arch/common.py b/scapy/arch/common.py index c2c8897ce8c..e2bddd3516b 100644 --- a/scapy/arch/common.py +++ b/scapy/arch/common.py @@ -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 @@ -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 diff --git a/scapy/data.py b/scapy/data.py index a577e14c090..a1a8e3c8316 100644 --- a/scapy/data.py +++ b/scapy/data.py @@ -202,7 +202,7 @@ ARPHRD_CHAOS: DLT_CHAOS, ARPHRD_CAN: DLT_LINUX_SLL, ARPHRD_IEEE802_TR: DLT_IEEE802, - ARPHRD_IEEE802: DLT_IEEE802, + ARPHRD_IEEE802: DLT_EN10MB, ARPHRD_ARCNET: DLT_ARCNET_LINUX, ARPHRD_FDDI: DLT_FDDI, ARPHRD_ATM: -1,