Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scapy
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
external
scapy
Commits
bb22ba4e
Commit
bb22ba4e
authored
7 years ago
by
Pierre LALET
Browse files
Options
Downloads
Patches
Plain Diff
BPF: code clean-up
parent
4fe539f5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scapy/arch/bpf/supersocket.py
+5
-8
5 additions, 8 deletions
scapy/arch/bpf/supersocket.py
with
5 additions
and
8 deletions
scapy/arch/bpf/supersocket.py
+
5
−
8
View file @
bb22ba4e
...
@@ -363,22 +363,19 @@ def bpf_select(fds_list, timeout=None):
...
@@ -363,22 +363,19 @@ def bpf_select(fds_list, timeout=None):
for
tmp_fd
in
fds_list
:
for
tmp_fd
in
fds_list
:
# Specific BPF sockets
# Specific BPF sockets: get buffers status
if
isBPFSocket
(
tmp_fd
):
if
isBPFSocket
(
tmp_fd
)
and
tmp_fd
.
buffered_frames
():
# Get buffers status
bpf_scks_buffered
.
append
(
tmp_fd
)
if
tmp_fd
.
buffered_frames
():
continue
bpf_scks_buffered
.
append
(
tmp_fd
)
continue
# Regular file descriptors or empty BPF buffer
# Regular file descriptors or empty BPF buffer
select_fds
.
append
(
tmp_fd
)
select_fds
.
append
(
tmp_fd
)
if
len
(
select_fds
)
:
if
select_fds
:
# Call select for sockets with empty buffers
# Call select for sockets with empty buffers
if
timeout
is
None
:
if
timeout
is
None
:
timeout
=
0.05
timeout
=
0.05
ready_list
,
_
,
_
=
select
(
select_fds
,
[],
[],
timeout
)
ready_list
,
_
,
_
=
select
(
select_fds
,
[],
[],
timeout
)
return
bpf_scks_buffered
+
ready_list
return
bpf_scks_buffered
+
ready_list
else
:
else
:
return
bpf_scks_buffered
return
bpf_scks_buffered
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment