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
8b6dabf7
Commit
8b6dabf7
authored
Mar 11, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send requests when receiving unfeasible updates if they're any good.
parent
55ad5c60
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
route.c
route.c
+27
-2
route.h
route.h
+2
-0
No files found.
route.c
View file @
8b6dabf7
...
@@ -384,11 +384,16 @@ update_route(const unsigned char *a, const unsigned char *p, unsigned char plen,
...
@@ -384,11 +384,16 @@ update_route(const unsigned char *a, const unsigned char *p, unsigned char plen,
if
(
feasible
)
if
(
feasible
)
trigger_route_change
(
route
,
oldsrc
,
oldmetric
);
trigger_route_change
(
route
,
oldsrc
,
oldmetric
);
else
if
(
lost
)
else
send_unfeasible_request
(
metric
,
a
,
p
,
plen
);
if
(
lost
)
route_lost
(
oldsrc
,
oldmetric
);
route_lost
(
oldsrc
,
oldmetric
);
}
else
{
}
else
{
if
(
!
feasible
)
if
(
!
feasible
)
{
send_unfeasible_request
(
metric
,
a
,
p
,
plen
);
return
NULL
;
return
NULL
;
}
if
(
refmetric
>=
INFINITY
)
if
(
refmetric
>=
INFINITY
)
/* Somebody's retracting a route we never saw. */
/* Somebody's retracting a route we never saw. */
return
NULL
;
return
NULL
;
...
@@ -412,6 +417,26 @@ update_route(const unsigned char *a, const unsigned char *p, unsigned char plen,
...
@@ -412,6 +417,26 @@ update_route(const unsigned char *a, const unsigned char *p, unsigned char plen,
return
route
;
return
route
;
}
}
/* We just received an unfeasible update. If it's any good, send
a request for a new seqno. */
void
send_unfeasible_request
(
unsigned
short
metric
,
const
unsigned
char
*
a
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
)
{
struct
route
*
route
=
find_installed_route
(
prefix
,
plen
);
struct
source
*
src
=
find_source
(
a
,
prefix
,
plen
,
0
,
0
);
if
(
src
==
NULL
)
return
;
if
(
!
route
||
route
->
metric
>=
metric
+
256
)
{
send_request_resend
(
prefix
,
plen
,
src
->
metric
>=
INFINITY
?
src
->
seqno
:
seqno_plus
(
src
->
seqno
,
1
),
hash_id
(
src
->
address
));
}
}
/* This takes a feasible route and decides whether to install it. The only
/* This takes a feasible route and decides whether to install it. The only
condition that it must satisfy is that if there is no currently installed
condition that it must satisfy is that if there is no currently installed
route, then one will be installed. */
route, then one will be installed. */
...
...
route.h
View file @
8b6dabf7
...
@@ -64,6 +64,8 @@ struct route *update_route(const unsigned char *a,
...
@@ -64,6 +64,8 @@ struct route *update_route(const unsigned char *a,
unsigned
short
seqno
,
unsigned
short
refmetric
,
unsigned
short
seqno
,
unsigned
short
refmetric
,
struct
neighbour
*
neigh
,
struct
neighbour
*
neigh
,
const
unsigned
char
*
nexthop
);
const
unsigned
char
*
nexthop
);
void
send_unfeasible_request
(
unsigned
short
metric
,
const
unsigned
char
*
a
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
);
void
consider_route
(
struct
route
*
route
);
void
consider_route
(
struct
route
*
route
);
void
send_triggered_update
(
struct
route
*
route
,
void
send_triggered_update
(
struct
route
*
route
,
struct
source
*
oldsrc
,
int
oldmetric
);
struct
source
*
oldsrc
,
int
oldmetric
);
...
...
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