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
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
external
scapy
Commits
84e5bf6a
Commit
84e5bf6a
authored
Sep 21, 2015
by
jogarock
Browse files
Options
Downloads
Patches
Plain Diff
Modified to meet PR standards. See PR conversation
--HG-- branch : issue_5141
parent
364a290e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
scapy/contrib/cdp.py
+7
-7
7 additions, 7 deletions
scapy/contrib/cdp.py
with
7 additions
and
7 deletions
scapy/contrib/cdp.py
+
7
−
7
View file @
84e5bf6a
...
@@ -289,17 +289,17 @@ class CDPMsg(CDPMsgGeneric):
...
@@ -289,17 +289,17 @@ class CDPMsg(CDPMsgGeneric):
class
_CDPChecksum
:
class
_CDPChecksum
:
def
_check_len
(
self
,
pkt
):
def
_check_len
(
self
,
pkt
):
"""
Check for odd packet length and pad according to Cisco spec
"""
"""
Check for odd packet length and pad according to Cisco spec.
This padding is only used for checksum computation. The original
packet should not be altered.
"""
if
len
(
pkt
)
%
2
:
if
len
(
pkt
)
%
2
:
last_chr
=
pkt
[
-
1
]
last_chr
=
pkt
[
-
1
]
if
ord
(
last_chr
)
<=
0
x80
:
if
last_chr
<=
'
\
x80
'
:
ck_p
=
pkt
[:
-
1
]
+
'
\x00
'
+
last_chr
return
pkt
[:
-
1
]
+
'
\x00
'
+
last_chr
else
:
else
:
ck_p
=
pkt
[:
-
1
]
+
'
\xff
'
+
chr
(
ord
(
last_chr
)
-
1
)
return
pkt
[:
-
1
]
+
'
\xff
'
+
chr
(
ord
(
last_chr
)
-
1
)
else
:
else
:
ck_p
=
pkt
return
pkt
return
ck_p
def
post_build
(
self
,
pkt
,
pay
):
def
post_build
(
self
,
pkt
,
pay
):
p
=
pkt
+
pay
p
=
pkt
+
pay
...
...
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