Skip to content

Commit

Permalink
Merge pull request #1653 from guedou/Fix_Issue#1623
Browse files Browse the repository at this point in the history
Don't put the interface in promiscuous mode while getting the BPF filter
  • Loading branch information
gpotter2 committed Oct 19, 2018
2 parents 17b5a56 + 863df1e commit f781d11
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion scapy/arch/bpf/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def attach_filter(fd, iface, bpf_filter_string):
"""Attach a BPF filter to the BPF file descriptor"""

# Retrieve the BPF byte code in decimal
command = "%s -i %s -ddd -s 1600 '%s'" % (conf.prog.tcpdump, iface, bpf_filter_string) # noqa: E501
cmd_fmt = "%s -p -i %s -ddd -s 1600 '%s'"
command = cmd_fmt % (conf.prog.tcpdump, iface, bpf_filter_string)
try:
f = os.popen(command)
except OSError as msg:
Expand Down
2 changes: 1 addition & 1 deletion scapy/arch/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def attach_filter(s, bpf_filter, iface):
if not TCPDUMP:
return
try:
f = os.popen("%s -i %s -ddd -s %d '%s'" % (
f = os.popen("%s -p -i %s -ddd -s %d '%s'" % (
conf.prog.tcpdump,
conf.iface if iface is None else iface,
MTU,
Expand Down

0 comments on commit f781d11

Please sign in to comment.