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
449c8d59
Commit
449c8d59
authored
Sep 24, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove support for forced xroutes.
Significantly simplifies the xroute logic.
parent
f915c7a8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
39 deletions
+21
-39
babel.c
babel.c
+2
-3
xroute.c
xroute.c
+18
-31
xroute.h
xroute.h
+1
-5
No files found.
babel.c
View file @
449c8d59
...
@@ -968,10 +968,9 @@ dump_tables(FILE *out)
...
@@ -968,10 +968,9 @@ dump_tables(FILE *out)
neigh
->
network
->
up
?
""
:
" (down)"
);
neigh
->
network
->
up
?
""
:
" (down)"
);
}
}
for
(
i
=
0
;
i
<
numxroutes
;
i
++
)
{
for
(
i
=
0
;
i
<
numxroutes
;
i
++
)
{
fprintf
(
out
,
"%s metric %d (
%s
)
\n
"
,
fprintf
(
out
,
"%s metric %d (
exported
)
\n
"
,
format_prefix
(
xroutes
[
i
].
prefix
,
xroutes
[
i
].
plen
),
format_prefix
(
xroutes
[
i
].
prefix
,
xroutes
[
i
].
plen
),
xroutes
[
i
].
metric
,
xroutes
[
i
].
metric
);
xroutes
[
i
].
kind
==
XROUTE_FORCED
?
"forced"
:
"exported"
);
}
}
for
(
i
=
0
;
i
<
numroutes
;
i
++
)
{
for
(
i
=
0
;
i
<
numroutes
;
i
++
)
{
int
id
=
int
id
=
...
...
xroute.c
View file @
449c8d59
...
@@ -85,18 +85,11 @@ flush_xroute(struct xroute *xroute)
...
@@ -85,18 +85,11 @@ flush_xroute(struct xroute *xroute)
}
}
int
int
add_xroute
(
int
kind
,
unsigned
char
prefix
[
16
],
unsigned
char
plen
,
add_xroute
(
unsigned
char
prefix
[
16
],
unsigned
char
plen
,
unsigned
short
metric
,
unsigned
int
ifindex
,
int
proto
)
unsigned
short
metric
,
unsigned
int
ifindex
,
int
proto
)
{
{
struct
xroute
*
xroute
=
find_xroute
(
prefix
,
plen
);
struct
xroute
*
xroute
=
find_xroute
(
prefix
,
plen
);
if
(
xroute
)
{
if
(
xroute
)
{
if
(
xroute
->
kind
<
kind
)
return
0
;
else
if
(
xroute
->
kind
>
kind
)
{
flush_xroute
(
xroute
);
return
add_xroute
(
kind
,
prefix
,
plen
,
metric
,
ifindex
,
proto
);
}
if
(
xroute
->
metric
<=
metric
)
if
(
xroute
->
metric
<=
metric
)
return
0
;
return
0
;
xroute
->
metric
=
metric
;
xroute
->
metric
=
metric
;
...
@@ -116,7 +109,6 @@ add_xroute(int kind, unsigned char prefix[16], unsigned char plen,
...
@@ -116,7 +109,6 @@ add_xroute(int kind, unsigned char prefix[16], unsigned char plen,
xroutes
=
new_xroutes
;
xroutes
=
new_xroutes
;
}
}
xroutes
[
numxroutes
].
kind
=
kind
;
memcpy
(
xroutes
[
numxroutes
].
prefix
,
prefix
,
16
);
memcpy
(
xroutes
[
numxroutes
].
prefix
,
prefix
,
16
);
xroutes
[
numxroutes
].
plen
=
plen
;
xroutes
[
numxroutes
].
plen
=
plen
;
xroutes
[
numxroutes
].
metric
=
metric
;
xroutes
[
numxroutes
].
metric
=
metric
;
...
@@ -168,9 +160,6 @@ check_xroutes(int send_updates)
...
@@ -168,9 +160,6 @@ check_xroutes(int send_updates)
i
=
0
;
i
=
0
;
while
(
i
<
numxroutes
)
{
while
(
i
<
numxroutes
)
{
export
=
0
;
export
=
0
;
if
(
xroutes
[
i
].
kind
==
XROUTE_FORCED
)
{
export
=
1
;
}
else
if
(
xroutes
[
i
].
kind
==
XROUTE_REDISTRIBUTED
)
{
metric
=
redistribute_filter
(
xroutes
[
i
].
prefix
,
xroutes
[
i
].
plen
,
metric
=
redistribute_filter
(
xroutes
[
i
].
prefix
,
xroutes
[
i
].
plen
,
xroutes
[
i
].
ifindex
,
xroutes
[
i
].
proto
);
xroutes
[
i
].
ifindex
,
xroutes
[
i
].
proto
);
if
((
metric
<
INFINITY
&&
metric
==
xroutes
[
i
].
metric
)
||
if
((
metric
<
INFINITY
&&
metric
==
xroutes
[
i
].
metric
)
||
...
@@ -191,7 +180,6 @@ check_xroutes(int send_updates)
...
@@ -191,7 +180,6 @@ check_xroutes(int send_updates)
}
}
}
}
}
}
}
if
(
!
export
)
{
if
(
!
export
)
{
unsigned
char
prefix
[
16
],
plen
;
unsigned
char
prefix
[
16
],
plen
;
...
@@ -222,8 +210,7 @@ check_xroutes(int send_updates)
...
@@ -222,8 +210,7 @@ check_xroutes(int send_updates)
if
(
metric
==
METRIC_INHERIT
)
if
(
metric
==
METRIC_INHERIT
)
metric
=
routes
[
i
].
metric
*
256
;
metric
=
routes
[
i
].
metric
*
256
;
if
(
metric
<
INFINITY
)
{
if
(
metric
<
INFINITY
)
{
rc
=
add_xroute
(
XROUTE_REDISTRIBUTED
,
rc
=
add_xroute
(
routes
[
i
].
prefix
,
routes
[
i
].
plen
,
routes
[
i
].
prefix
,
routes
[
i
].
plen
,
metric
,
routes
[
i
].
ifindex
,
routes
[
i
].
proto
);
metric
,
routes
[
i
].
ifindex
,
routes
[
i
].
proto
);
if
(
rc
)
{
if
(
rc
)
{
struct
route
*
route
;
struct
route
*
route
;
...
...
xroute.h
View file @
449c8d59
...
@@ -22,13 +22,9 @@ THE SOFTWARE.
...
@@ -22,13 +22,9 @@ THE SOFTWARE.
/* These should come in decreasing order of priority. */
/* These should come in decreasing order of priority. */
#define XROUTE_FORCED 1
#define XROUTE_REDISTRIBUTED 2
struct
xroute
{
struct
xroute
{
unsigned
char
prefix
[
16
];
unsigned
char
prefix
[
16
];
unsigned
char
plen
;
unsigned
char
plen
;
char
kind
;
unsigned
short
metric
;
unsigned
short
metric
;
unsigned
int
ifindex
;
unsigned
int
ifindex
;
int
proto
;
int
proto
;
...
@@ -39,6 +35,6 @@ extern int numxroutes;
...
@@ -39,6 +35,6 @@ extern int numxroutes;
struct
xroute
*
find_xroute
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
);
struct
xroute
*
find_xroute
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
);
void
flush_xroute
(
struct
xroute
*
xroute
);
void
flush_xroute
(
struct
xroute
*
xroute
);
int
add_xroute
(
int
kind
,
unsigned
char
prefix
[
16
],
unsigned
char
plen
,
int
add_xroute
(
unsigned
char
prefix
[
16
],
unsigned
char
plen
,
unsigned
short
metric
,
unsigned
int
ifindex
,
int
proto
);
unsigned
short
metric
,
unsigned
int
ifindex
,
int
proto
);
int
check_xroutes
(
int
send_updates
);
int
check_xroutes
(
int
send_updates
);
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