Skip to content

Conversation

@guedou
Copy link
Member

@guedou guedou commented Jun 24, 2019

This PR fixes #1929.

The original sniff() was not supposed to work this way. However, I find it quite useful to be able to build packets with Scapy and filter them with tcpdump. This a great way to test BPF filters.

I am no 100% happy with the current implementation but it seems to work fine.

@guedou guedou force-pushed the issue_1929_packets branch from 395a742 to 6969893 Compare June 24, 2019 19:38
gpotter2
gpotter2 previously approved these changes Jun 24, 2019
@guedou guedou force-pushed the issue_1929_packets branch 2 times, most recently from 121e030 to e421169 Compare June 25, 2019 10:08
@codecov
Copy link

codecov bot commented Jun 25, 2019

Codecov Report

Merging #2101 into master will decrease coverage by 0.7%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #2101      +/-   ##
==========================================
- Coverage   87.18%   86.47%   -0.71%     
==========================================
  Files         197      197              
  Lines       44486    44495       +9     
==========================================
- Hits        38787    38479     -308     
- Misses       5699     6016     +317
Impacted Files Coverage Δ
scapy/sendrecv.py 84.56% <100%> (+0.23%) ⬆️
scapy/arch/bpf/supersocket.py 27.9% <0%> (-50.24%) ⬇️
scapy/layers/dhcp6.py 63.38% <0%> (-21.76%) ⬇️
scapy/contrib/isotp.py 82.03% <0%> (-6.3%) ⬇️
scapy/arch/bpf/core.py 81.37% <0%> (-5.89%) ⬇️
scapy/arch/pcapdnet.py 65.51% <0%> (-4.14%) ⬇️
scapy/utils6.py 86.75% <0%> (-0.46%) ⬇️
scapy/contrib/http2.py 96.46% <0%> (-0.35%) ⬇️
scapy/layers/inet6.py 88.1% <0%> (-0.12%) ⬇️
scapy/fields.py 92.22% <0%> (+0.31%) ⬆️
... and 1 more

@guedou guedou force-pushed the issue_1929_packets branch from e421169 to fb037a0 Compare June 25, 2019 10:56
@guedou
Copy link
Member Author

guedou commented Jun 25, 2019

@gpotter2 ready to be reviewed and merged.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we don't want to use scapy.utils.get_temp_file(autoext=".pcap") instead

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right!

gpotter2
gpotter2 previously approved these changes Jun 26, 2019
Copy link
Member

@gpotter2 gpotter2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small comment, otherwise good to go

@guedou guedou force-pushed the issue_1929_packets branch from 5385885 to 59f2fb1 Compare June 27, 2019 08:31
@gpotter2 gpotter2 merged commit c141b3a into secdev:master Jun 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sniff(offline=...) call blocks when output is large

2 participants