Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
3f8f2e3a
Commit
3f8f2e3a
authored
Aug 24, 2021
by
Antoine Kaufmann
Browse files
dist/sockets: calculate message size for entries messages correctly
These were too large until now.
parent
a69db6db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
dist/sockets/net_sockets.c
dist/sockets/net_sockets.c
+2
-2
No files found.
dist/sockets/net_sockets.c
View file @
3f8f2e3a
...
@@ -363,7 +363,7 @@ static int SockMsgRxEntries(struct SockMsg *msg) {
...
@@ -363,7 +363,7 @@ static int SockMsgRxEntries(struct SockMsg *msg) {
uint32_t
len
=
entries
->
num_entries
*
peer
->
cleanup_elen
;
uint32_t
len
=
entries
->
num_entries
*
peer
->
cleanup_elen
;
if
(
len
+
sizeof
(
*
msg
)
!=
msg
->
msg_len
)
{
if
(
len
+
offsetof
(
struct
SockMsg
,
entries
.
data
)
!=
msg
->
msg_len
)
{
fprintf
(
stderr
,
"SockMsgRxEntries: invalid message length (m=%u l=%u)
\n
"
,
fprintf
(
stderr
,
"SockMsgRxEntries: invalid message length (m=%u l=%u)
\n
"
,
msg
->
msg_len
,
len
);
msg
->
msg_len
,
len
);
abort
();
abort
();
...
@@ -533,7 +533,7 @@ int NetOpPassEntries(struct Peer *peer, uint32_t pos, uint32_t n) {
...
@@ -533,7 +533,7 @@ int NetOpPassEntries(struct Peer *peer, uint32_t pos, uint32_t n) {
}
}
fprintf(stderr, "\n");*/
fprintf(stderr, "\n");*/
#endif
#endif
msg
->
msg_len
=
sizeof
(
*
msg
)
+
len
;
msg
->
msg_len
=
offsetof
(
struct
SockMsg
,
entries
.
data
)
+
len
;
int
ret
=
SockSend
(
msg
);
int
ret
=
SockSend
(
msg
);
SockMsgFree
(
msg
);
SockMsgFree
(
msg
);
...
...
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