Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
4ffe9734
Commit
4ffe9734
authored
May 16, 2014
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add safety check in fill_rtt_message.
parent
dabc3f3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
message.c
message.c
+15
-7
No files found.
message.c
View file @
4ffe9734
...
...
@@ -663,13 +663,21 @@ static int
fill_rtt_message
(
struct
interface
*
ifp
)
{
if
(
ifp
->
enable_timestamps
&&
(
ifp
->
buffered_hello
>=
0
))
{
unsigned
int
time
;
/* Change the type of sub-TLV. */
ifp
->
sendbuf
[
ifp
->
buffered_hello
+
8
]
=
SUBTLV_TIMESTAMP
;
gettime
(
&
now
);
time
=
time_us
(
now
);
DO_HTONL
(
ifp
->
sendbuf
+
ifp
->
buffered_hello
+
10
,
time
);
return
1
;
if
(
ifp
->
sendbuf
[
ifp
->
buffered_hello
+
8
]
==
SUBTLV_PADN
&&
ifp
->
sendbuf
[
ifp
->
buffered_hello
+
9
]
==
4
)
{
unsigned
int
time
;
/* Change the type of sub-TLV. */
ifp
->
sendbuf
[
ifp
->
buffered_hello
+
8
]
=
SUBTLV_TIMESTAMP
;
gettime
(
&
now
);
time
=
time_us
(
now
);
DO_HTONL
(
ifp
->
sendbuf
+
ifp
->
buffered_hello
+
10
,
time
);
return
1
;
}
else
{
fprintf
(
stderr
,
"No space left for timestamp sub-TLV "
"(this shouldn't happen)
\n
"
);
return
-
1
;
}
}
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment