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
d3734a10
Commit
d3734a10
authored
Dec 20, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix retractions with no router-id.
Thanks to Fabian Blaese.
parent
f9698a56
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
4 deletions
+25
-4
message.c
message.c
+3
-2
route.c
route.c
+22
-2
No files found.
message.c
View file @
d3734a10
...
...
@@ -718,7 +718,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
}
have_router_id
=
1
;
}
if
(
!
have_router_id
&&
message
[
2
]
!=
0
)
{
if
(
metric
<
INFINITY
&&
!
have_router_id
&&
message
[
2
]
!=
0
)
{
fprintf
(
stderr
,
"Received prefix with no router id.
\n
"
);
goto
fail
;
}
...
...
@@ -773,7 +773,8 @@ parse_packet(const unsigned char *from, struct interface *ifp,
goto
done
;
}
update_route
(
router_id
,
prefix
,
plen
,
src_prefix
,
src_plen
,
seqno
,
update_route
(
have_router_id
?
router_id
:
NULL
,
prefix
,
plen
,
src_prefix
,
src_plen
,
seqno
,
metric
,
interval
,
neigh
,
nh
,
channels
,
channels_len
);
}
else
if
(
type
==
MESSAGE_REQUEST
)
{
...
...
route.c
View file @
d3734a10
...
...
@@ -877,8 +877,15 @@ update_route(const unsigned char *id,
int
add_metric
;
int
hold_time
=
MAX
((
4
*
interval
)
/
100
+
interval
/
50
,
15
);
int
is_v4
;
if
(
memcmp
(
id
,
myid
,
8
)
==
0
)
if
(
!
id
)
{
if
(
refmetric
<
INFINITY
)
{
fprintf
(
stderr
,
"Update with no id and finite metric."
);
return
NULL
;
}
}
else
if
(
memcmp
(
id
,
myid
,
8
)
==
0
)
{
return
NULL
;
}
if
(
martian_prefix
(
prefix
,
plen
)
||
martian_prefix
(
src_prefix
,
src_plen
))
{
fprintf
(
stderr
,
"Rejecting martian route to %s from %s through %s.
\n
"
,
...
...
@@ -898,6 +905,19 @@ update_route(const unsigned char *id,
route
=
find_route
(
prefix
,
plen
,
src_prefix
,
src_plen
,
neigh
,
nexthop
);
if
(
refmetric
>=
INFINITY
&&
!
route
)
{
/* Somebody's retracting a route that we've never seen. */
return
NULL
;
}
else
if
(
!
id
)
{
/* Pretend the retraction came from the currently installed source. */
id
=
route
->
src
->
id
;
}
if
(
!
id
)
{
fprintf
(
stderr
,
"No id in update_route -- this shouldn't happen.
\n
"
);
return
NULL
;
}
if
(
route
&&
memcmp
(
route
->
src
->
id
,
id
,
8
)
==
0
)
/* Avoid scanning the source table. */
src
=
route
->
src
;
...
...
@@ -919,7 +939,7 @@ update_route(const unsigned char *id,
oldsrc
=
route
->
src
;
oldmetric
=
route_metric
(
route
);
/* If a successor switches sources, we must accept
his
update even
/* If a successor switches sources, we must accept
their
update even
if it makes a route unfeasible in order to break any routing loops
in a timely manner. If the source remains the same, we ignore
the update. */
...
...
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