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
024c17ae
Commit
024c17ae
authored
Jun 18, 2020
by
Antonin Décimo
Committed by
Juliusz Chroboczek
May 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix confusion between INDEX_LEN and NONCE_LEN when sending PC TLV.
parent
ceb021fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
message.c
message.c
+5
-4
No files found.
message.c
View file @
024c17ae
...
...
@@ -1148,7 +1148,7 @@ static void
ensure_space
(
struct
buffered
*
buf
,
struct
interface
*
ifp
,
int
space
)
{
if
(
ifp
->
key
!=
NULL
)
space
+=
MAX_HMAC_SPACE
+
6
+
NONCE
_LEN
;
space
+=
MAX_HMAC_SPACE
+
6
+
INDEX
_LEN
;
if
(
buf
->
size
-
buf
->
len
<
space
)
flushbuf
(
buf
,
ifp
);
}
...
...
@@ -1156,8 +1156,9 @@ ensure_space(struct buffered *buf, struct interface *ifp, int space)
static
void
start_message
(
struct
buffered
*
buf
,
struct
interface
*
ifp
,
int
type
,
int
len
)
{
int
space
=
ifp
->
key
==
NULL
?
len
+
2
:
len
+
2
+
MAX_HMAC_SPACE
+
6
+
NONCE_LEN
;
int
space
=
ifp
->
key
==
NULL
?
len
+
2
:
len
+
2
+
MAX_HMAC_SPACE
+
6
+
INDEX_LEN
;
if
(
buf
->
size
-
buf
->
len
<
space
)
flushbuf
(
buf
,
ifp
);
buf
->
buf
[
buf
->
len
++
]
=
type
;
...
...
@@ -1204,7 +1205,7 @@ accumulate_bytes(struct buffered *buf,
int
send_pc
(
struct
buffered
*
buf
,
struct
interface
*
ifp
)
{
int
space
=
2
+
MAX_HMAC_SPACE
+
6
+
NONCE
_LEN
;
int
space
=
MAX_HMAC_SPACE
+
6
+
INDEX
_LEN
;
if
(
buf
->
size
-
buf
->
len
<
space
)
{
fputs
(
"send_pc: no space left to accumulate pc.
\n
"
,
stderr
);
return
-
1
;
...
...
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