Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tsn-measures
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
tsn-measures
Commits
bd13db96
Commit
bd13db96
authored
Jun 24, 2020
by
Joanne Hugé
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix still present segmentation fault caused by incrementing index without modulo
parent
d067cff7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
packet-exchange/src/send_packet.c
packet-exchange/src/send_packet.c
+4
-2
No files found.
packet-exchange/src/send_packet.c
View file @
bd13db96
...
...
@@ -131,7 +131,8 @@ void send_udp_packet(char *data,
if
(
params
->
use_timestamps
)
{
clock_gettime
(
CLOCK_REALTIME
,
&
ts
);
timestamps_buffer
[(
ts_buf_write_index
++
)
%
TIMESTAMP_BUFFER_SIZE
]
=
ts_to_uint
(
ts
);
timestamps_buffer
[
ts_buf_write_index
]
=
ts_to_uint
(
ts
);
ts_buf_write_index
=
(
ts_buf_write_index
+
1
)
%
TIMESTAMP_BUFFER_SIZE
;
}
packets_sent
++
;
...
...
@@ -222,7 +223,8 @@ static void process_error_queue() {
struct
timespec
*
stamp
=
(
struct
timespec
*
)
CMSG_DATA
(
cmsg
);
int
kernel_latency
=
(
ts_to_uint
(
*
stamp
)
-
timestamps_buffer
[(
ts_buf_read_index
++
)
%
TIMESTAMP_BUFFER_SIZE
])
/
1000
;
int
kernel_latency
=
(
ts_to_uint
(
*
stamp
)
-
timestamps_buffer
[
ts_buf_read_index
])
/
1000
;
ts_buf_read_index
=
(
ts_buf_read_index
+
1
)
%
TIMESTAMP_BUFFER_SIZE
;
stats
->
min_kernel_latency
=
min
(
kernel_latency
,
stats
->
min_kernel_latency
);
stats
->
max_kernel_latency
=
max
(
kernel_latency
,
stats
->
max_kernel_latency
);
...
...
Joanne Hugé
@jhuge
mentioned in commit
2aa17b73
·
Jul 31, 2020
mentioned in commit
2aa17b73
mentioned in commit 2aa17b73fd8c7c5a0c0e35ba717a55e84582700d
Toggle commit list
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