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
957fffd4
Commit
957fffd4
authored
10 years ago
by
Michael Tüxen
Browse files
Options
Downloads
Patches
Plain Diff
Improve padding handling. This handles now INITs from FreeBSD.
parent
ca0ca32d
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/sctp_iterator.c
+14
-4
14 additions, 4 deletions
gtests/net/packetdrill/sctp_iterator.c
with
14 additions
and
4 deletions
gtests/net/packetdrill/sctp_iterator.c
+
14
−
4
View file @
957fffd4
/*
* Copyright 2013 Google Inc.
* Copyright 2015 Michael Tuexen
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
@@ -17,7 +18,7 @@
* 02110-1301, USA.
*/
/*
* Author:
ncardwell@google.com (Neal Cardwell
)
* Author:
tuexen@fh-muenster.de (Michael Tuexen
)
*
* Implementation for module to allow iteration over SCTP chunks and
* parameters in wire format.
...
...
@@ -80,7 +81,10 @@ struct sctp_chunk *sctp_chunks_next(struct sctp_chunks_iterator *iter,
assert
(
chunk_length
>=
sizeof
(
struct
sctp_chunk
));
assert
(
padding_length
<
4
);
iter
->
current_chunk
+=
chunk_length
;
iter
->
current_chunk
+=
padding_length
;
if
(
iter
->
packet_end
-
iter
->
current_chunk
<
padding_length
)
iter
->
current_chunk
=
iter
->
packet_end
;
else
iter
->
current_chunk
+=
padding_length
;
return
get_current_chunk
(
iter
,
error
);
}
...
...
@@ -139,7 +143,10 @@ sctp_parameters_next(struct sctp_parameters_iterator *iter,
assert
(
parameter_length
>=
sizeof
(
struct
sctp_parameter
));
assert
(
padding_length
<
4
);
iter
->
current_parameter
+=
parameter_length
;
iter
->
current_parameter
+=
padding_length
;
if
(
iter
->
end
-
iter
->
current_parameter
<
padding_length
)
iter
->
current_parameter
=
iter
->
end
;
else
iter
->
current_parameter
+=
padding_length
;
return
get_current_parameter
(
iter
,
error
);
}
...
...
@@ -195,6 +202,9 @@ struct sctp_cause *sctp_causes_next(struct sctp_causes_iterator *iter,
assert
(
cause_length
>=
sizeof
(
struct
sctp_cause
));
assert
(
padding_length
<
4
);
iter
->
current_cause
+=
cause_length
;
iter
->
current_cause
+=
padding_length
;
if
(
iter
->
chunk_end
-
iter
->
current_cause
<
padding_length
)
iter
->
current_cause
=
iter
->
chunk_end
;
else
iter
->
current_cause
+=
padding_length
;
return
get_current_cause
(
iter
,
error
);
}
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