secdev / secdev/scapy

sniff does not terminate on timeout

Open
#4,590 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
12.6k
Forks
2.2k
Avg merge
1d 4h
Merged PRs (30d)
56

Description

Brief description

OS Debian 12, scapy v.2.6.1
The timeout parameter does not work when capturing packets:
sniff(iface = interface, filter=“port 9999”, count = 1, timeout = 10)
If there are no packets to capture, sniff should terminate after 10 seconds, but it does not - the program hangs.

Scapy version

2.6.1

Python version

3.11.2

Operating system

Linux 6.1.0-26-amd64 x86_64

Additional environment information

No response

How to reproduce

data = sniff(iface = interface, filter="port 9999", count = 1, timeout = 10)
print(data)

Actual result

No response

Expected result

No response

Related resources

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at Scapy's sniff entry point and run the provided reproduction with Debian 12, Python 3.11.2, Scapy 2.6.1, and no packets on port 9999. Trace how count and timeout are handled during capture, then verify that the command returns after 10 seconds and add or update coverage for this scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.