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
5fb59d2e
Commit
5fb59d2e
authored
8 years ago
by
Todd Freed
Browse files
Options
Downloads
Patches
Plain Diff
coap: dont reorder options having the same option number
parent
e8b5a189
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scapy/contrib/coap.py
+1
-1
1 addition, 1 deletion
scapy/contrib/coap.py
scapy/contrib/coap.uts
+6
-0
6 additions, 0 deletions
scapy/contrib/coap.uts
with
7 additions
and
1 deletion
scapy/contrib/coap.py
+
1
−
1
View file @
5fb59d2e
...
...
@@ -178,7 +178,7 @@ class _CoAPOptsField(StrField):
opt_lst
.
append
((
coap_options
[
1
][
o
[
0
]],
o
[
1
]))
else
:
opt_lst
.
append
(
o
)
opt_lst
.
sort
()
opt_lst
.
sort
(
key
=
lambda
o
:
o
[
0
]
)
opts
=
_CoAPOpt
(
delta
=
opt_lst
[
0
][
0
],
opt_val
=
opt_lst
[
0
][
1
])
high_opt
=
opt_lst
[
0
][
0
]
...
...
This diff is collapsed.
Click to expand it.
scapy/contrib/coap.uts
+
6
−
0
View file @
5fb59d2e
...
...
@@ -29,6 +29,12 @@ str(CoAP(options=[("Uri-Query", "query")])) == '\x40\x00\x00\x00\xd5\x02\x71\x75
= Extended option length
str(CoAP(options=[("Location-Path", 'x' * 280)])) == '\x40\x00\x00\x00\x8e\x0b\x00' + '\x78' * 280
= Options should be ordered by option number
str(CoAP(options=[("Uri-Query", "b"),("Uri-Path","a")])) == '\x40\x00\x00\x00\xb1\x61\x41\x62'
= Options of the same type should not be reordered
str(CoAP(options=[("Uri-Path", "b"),("Uri-Path","a")])) == '\x40\x00\x00\x00\xb1\x62\x01\x61'
+ Test layer binding
= Destination port
p = UDP()/CoAP()
...
...
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