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
245d762e
Commit
245d762e
authored
9 years ago
by
Pierre LALET
Browse files
Options
Downloads
Patches
Plain Diff
pcapng support: fix after review by @guedou
parent
bc1d9d54
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/utils.py
+2
-2
2 additions, 2 deletions
scapy/utils.py
with
2 additions
and
2 deletions
scapy/utils.py
+
2
−
2
View file @
245d762e
...
...
@@ -533,7 +533,7 @@ count: read only <count> packets"""
return
fdesc
.
read_all
(
count
=
count
)
def
rdpcapng
(
filename
,
count
=-
1
):
"""
Read a pcap file and return a packet list
"""
Read a pcap
ng
file and return a packet list
count: read only <count> packets
"""
## Does not work with Python <= 2.5. Use this implementation as
## soon as we drop support for Python 2.5.
...
...
@@ -688,7 +688,7 @@ class RawPcapNgReader(RawPcapReader):
except
IOError
:
self
.
f
=
open
(
filename
,
"
rb
"
)
magic
=
self
.
f
.
read
(
4
)
if
magic
!=
"
\
n\r\r\n
"
:
# PcapNg:
if
magic
!=
"
\
x0a\x0d\x0d\x0a
"
:
# PcapNg:
raise
Scapy_Exception
(
"
Not a pcapng capture file (bad magic: %r)
"
%
magic
)
...
...
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