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
6d7f1105
Commit
6d7f1105
authored
11 years ago
by
Guillaume Valadon
Browse files
Options
Downloads
Patches
Plain Diff
Close the file descriptor used to send packets
--HG-- branch : Issue #371
parent
421c0420
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scapy/arch/pcapdnet.py
+7
-0
7 additions, 0 deletions
scapy/arch/pcapdnet.py
with
7 additions
and
0 deletions
scapy/arch/pcapdnet.py
+
7
−
0
View file @
6d7f1105
...
...
@@ -50,6 +50,8 @@ if conf.use_pcap:
self
.
pcap
=
pcap
.
pcap
(
device
,
snaplen
,
promisc
,
immediate
=
1
)
def
__getattr__
(
self
,
attr
):
return
getattr
(
self
.
pcap
,
attr
)
def
__del__
(
self
):
warning
(
"
__del__: don
'
t know how to close the file descriptor. Bugs ahead ! Please report this bug.
"
)
open_pcap
=
lambda
*
args
,
**
kargs
:
_PcapWrapper_pypcap
(
*
args
,
**
kargs
)
elif
hasattr
(
pcap
,
"
pcapObject
"
):
# python-libpcap
class
_PcapWrapper_libpcap
:
...
...
@@ -66,6 +68,9 @@ if conf.use_pcap:
return
ts
,
pkt
def
__getattr__
(
self
,
attr
):
return
getattr
(
self
.
pcap
,
attr
)
def
__del__
(
self
):
fd
=
self
.
pcap
.
fileno
()
os
.
close
(
fd
)
open_pcap
=
lambda
*
args
,
**
kargs
:
_PcapWrapper_libpcap
(
*
args
,
**
kargs
)
elif
hasattr
(
pcap
,
"
open_live
"
):
# python-pcapy
class
_PcapWrapper_pcapy
:
...
...
@@ -85,6 +90,8 @@ if conf.use_pcap:
return
0
def
__getattr__
(
self
,
attr
):
return
getattr
(
self
.
pcap
,
attr
)
def
__del__
(
self
):
warning
(
"
__del__: don
'
t know how to close the file descriptor. Bugs ahead ! Please report this bug.
"
)
open_pcap
=
lambda
*
args
,
**
kargs
:
_PcapWrapper_pcapy
(
*
args
,
**
kargs
)
...
...
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