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
8cd5b3de
Commit
8cd5b3de
authored
Mar 12, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More simplification of handle_request.
parent
2afb6362
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
18 deletions
+19
-18
message.c
message.c
+19
-18
No files found.
message.c
View file @
8cd5b3de
...
@@ -271,26 +271,27 @@ handle_request(struct neighbour *neigh, const unsigned char *prefix,
...
@@ -271,26 +271,27 @@ handle_request(struct neighbour *neigh, const unsigned char *prefix,
seqno_compare
(
seqno
,
route
->
seqno
)
>
0
)))
{
seqno_compare
(
seqno
,
route
->
seqno
)
>
0
)))
{
/* No route, or the route we have is not fresh enough. */
/* No route, or the route we have is not fresh enough. */
if
(
hop_count
>
1
)
{
if
(
hop_count
>
1
)
{
struct
route
*
successor_route
;
struct
neighbour
*
successor
=
NULL
;
/* We usually want to send the request to our selected successor,
if
(
route
&&
route
->
metric
<
INFINITY
)
but not when it's the requestor, and not when we suspect that
successor
=
route
->
neigh
;
it's dead. So pick the best successor (feasible or not)
if our selected successor's metric is suspiciously large. */
if
(
!
successor
||
successor
==
neigh
)
{
struct
route
*
other_route
;
successor_route
=
find_best_route
(
prefix
,
plen
,
0
,
neigh
);
/* We're about to forward a request to the requestor.
if
(
!
successor_route
||
successor_route
->
metric
>=
INFINITY
||
Try to find a different neighbour to forward the
successor_route
->
neigh
==
neigh
)
request to. */
successor_route
=
route
;
else
if
(
route
&&
successor_route
&&
other_route
=
find_best_route
(
prefix
,
plen
,
0
,
neigh
);
successor_route
->
metric
+
256
>=
route
->
metric
)
if
(
other_route
&&
other_route
->
metric
<
INFINITY
)
successor_route
=
route
;
successor
=
other_route
->
neigh
;
}
if
(
!
successor_route
||
successor_route
->
metric
>=
INFINITY
||
successor_route
->
neigh
==
neigh
)
if
(
!
successor
||
successor
==
neigh
)
/* Give up */
return
;
return
;
send_unicast_request
(
successor
_route
->
neigh
,
prefix
,
plen
,
send_unicast_request
(
successor
,
prefix
,
plen
,
hop_count
-
1
,
seqno
,
router_hash
);
hop_count
-
1
,
seqno
,
router_hash
);
record_request
(
prefix
,
plen
,
seqno
,
router_hash
,
record_request
(
prefix
,
plen
,
seqno
,
router_hash
,
neigh
->
network
,
0
);
neigh
->
network
,
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