Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Packetdrill_tarr_ext
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Stefan Gense
Packetdrill_tarr_ext
Commits
b89feee7
Commit
b89feee7
authored
10 years ago
by
Michael Tüxen
Browse files
Options
Downloads
Patches
Plain Diff
Add support for SCTP.
parent
957fffd4
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
gtests/net/packetdrill/packet_checksum.c
+11
-3
11 additions, 3 deletions
gtests/net/packetdrill/packet_checksum.c
with
11 additions
and
3 deletions
gtests/net/packetdrill/packet_checksum.c
+
11
−
3
View file @
b89feee7
...
...
@@ -45,7 +45,11 @@ static void checksum_ipv4_packet(struct packet *packet)
assert
(
l4_bytes
>
0
);
/* Fill in IPv4-based layer 4 checksum. */
if
(
packet
->
tcp
!=
NULL
)
{
if
(
packet
->
sctp
!=
NULL
)
{
struct
sctp_common_header
*
sctp
=
packet
->
sctp
;
sctp
->
crc32c
=
0
;
sctp
->
crc32c
=
sctp_crc32c
(
sctp
,
l4_bytes
);
}
else
if
(
packet
->
tcp
!=
NULL
)
{
struct
tcp
*
tcp
=
packet
->
tcp
;
tcp
->
check
=
0
;
tcp
->
check
=
tcp_udp_v4_checksum
(
ipv4
->
src_ip
,
...
...
@@ -75,7 +79,7 @@ static void checksum_ipv4_packet(struct packet *packet)
icmpv4
->
checksum
=
0
;
icmpv4
->
checksum
=
ipv4_checksum
(
icmpv4
,
l4_bytes
);
}
else
{
assert
(
!
"not TCP or UDP or UDPLite or ICMP"
);
assert
(
!
"not
SCTP or
TCP or UDP or UDPLite or ICMP"
);
}
}
...
...
@@ -92,7 +96,11 @@ static void checksum_ipv6_packet(struct packet *packet)
assert
(
l4_bytes
>
0
);
/* Fill in IPv6-based layer 4 checksum. */
if
(
packet
->
tcp
!=
NULL
)
{
if
(
packet
->
sctp
!=
NULL
)
{
struct
sctp_common_header
*
sctp
=
packet
->
sctp
;
sctp
->
crc32c
=
0
;
sctp
->
crc32c
=
sctp_crc32c
(
sctp
,
l4_bytes
);
}
else
if
(
packet
->
tcp
!=
NULL
)
{
struct
tcp
*
tcp
=
packet
->
tcp
;
tcp
->
check
=
0
;
tcp
->
check
=
tcp_udp_v6_checksum
(
&
ipv6
->
src_ip
,
...
...
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