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
ceda3a02
Commit
ceda3a02
authored
Aug 19, 2020
by
Antonin Décimo
Committed by
Juliusz Chroboczek
May 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expire Index and challenge timer.
parent
d66a4d2b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
message.c
message.c
+9
-4
neighbour.c
neighbour.c
+2
-1
neighbour.h
neighbour.h
+1
-2
No files found.
message.c
View file @
ceda3a02
...
...
@@ -508,10 +508,16 @@ preparse_packet(const unsigned char *from, struct interface *ifp,
goto
done
;
gettime
(
&
now
);
if
(
timeval_compare
(
&
now
,
&
neigh
->
challenge_deadline
)
>
0
)
{
debugf
(
"No pending challenge.
\n
"
);
goto
done
;
}
if
(
len
==
sizeof
(
neigh
->
nonce
)
&&
memcmp
(
neigh
->
nonce
,
message
+
2
,
len
)
==
0
&&
timeval_compare
(
&
now
,
&
neigh
->
challenge_deadline
)
<=
0
)
{
memcmp
(
neigh
->
nonce
,
message
+
2
,
len
)
==
0
)
{
const
struct
timeval
zero
=
{
0
,
0
};
challenge_success
=
1
;
neigh
->
challenge_deadline
=
zero
;
}
else
{
debugf
(
"Challenge failed.
\n
"
);
}
...
...
@@ -529,12 +535,11 @@ preparse_packet(const unsigned char *from, struct interface *ifp,
neigh
->
index_len
=
index_len
;
memcpy
(
neigh
->
index
,
index
,
index_len
);
memcpy
(
neigh
->
pc
,
pc
,
4
);
neigh
->
have_index
=
1
;
accept_packet
=
1
;
goto
maybe_send_challenge_reply
;
}
if
(
neigh
==
NULL
||
!
neigh
->
have_index
||
neigh
->
index_len
!=
index_len
||
if
(
neigh
==
NULL
||
neigh
->
index_len
!=
index_len
||
memcmp
(
index
,
neigh
->
index
,
index_len
)
!=
0
)
{
neigh
=
neigh
!=
NULL
?
neigh
:
find_neighbour
(
from
,
ifp
);
if
(
neigh
==
NULL
)
...
...
neighbour.c
View file @
ceda3a02
...
...
@@ -108,7 +108,8 @@ find_neighbour(const unsigned char *address, struct interface *ifp)
neigh
->
hello_rtt_receive_time
=
zero
;
neigh
->
echo_receive_time
=
zero
;
neigh
->
rtt_time
=
zero
;
neigh
->
challenge_deadline
=
now
;
neigh
->
index_len
=
-
1
;
neigh
->
challenge_deadline
=
zero
;
neigh
->
ifp
=
ifp
;
neigh
->
buf
.
buf
=
buf
;
neigh
->
buf
.
size
=
ifp
->
buf
.
size
;
...
...
neighbour.h
View file @
ceda3a02
...
...
@@ -47,9 +47,8 @@ struct neighbour {
struct
timeval
echo_receive_time
;
unsigned
int
rtt
;
struct
timeval
rtt_time
;
int
have_index
;
int
index_len
;
unsigned
char
pc
[
4
];
int
index_len
;
/* This is -1 when index is undefined */
unsigned
char
index
[
32
];
unsigned
char
nonce
[
NONCE_LEN
];
struct
timeval
challenge_deadline
;
...
...
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