Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions scapy/arch/bpf/pfroute.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -1250,5 +1252,6 @@ def _get_if_list():
"flags": ifflags,
"mac": mac,
"ips": ips,
"type": itype,
}
return interfaces
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
2 changes: 1 addition & 1 deletion scapy/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading