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
73d2c811
Commit
73d2c811
authored
Apr 08, 2015
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make deny & src-prefix actions work in install filter
parent
378be94a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
12 deletions
+37
-12
babeld.man
babeld.man
+18
-0
configuration.c
configuration.c
+2
-6
disambiguation.c
disambiguation.c
+17
-6
No files found.
babeld.man
View file @
73d2c811
...
@@ -578,8 +578,26 @@ For a redistribute filter, redistribute this route with metric
...
@@ -578,8 +578,26 @@ For a redistribute filter, redistribute this route with metric
.IR value .
.IR value .
.TP
.TP
.BI src-prefix " prefix"
.BI src-prefix " prefix"
.RS
On Linux, this action is about the
.BR from
option in
.BR ip-route (8).
For a redistribute filter, set the source prefix of this route to
For a redistribute filter, set the source prefix of this route to
.IR prefix .
.IR prefix .
For an install filter:
.IP \(bu 2
when
.IR prefix
matches exactly the source prefix of the route to install,
the latter is cleared at install;
.IP \(bu
otherwise, the route is not installed.
.P
The purpose of such an install filter is mainly to provide a fallback for
routers without support of source-specific routes: only one route is kept,
to a router that will be able to route correctly.
.RE
.TP
.TP
.BI table " table"
.BI table " table"
In an
In an
...
...
configuration.c
View file @
73d2c811
...
@@ -1511,12 +1511,8 @@ install_filter(const unsigned char *prefix, unsigned short plen,
...
@@ -1511,12 +1511,8 @@ install_filter(const unsigned char *prefix, unsigned short plen,
unsigned
int
ifindex
,
unsigned
int
ifindex
,
struct
filter_result
*
result
)
struct
filter_result
*
result
)
{
{
int
res
;
return
do_filter
(
install_filters
,
NULL
,
prefix
,
plen
,
res
=
do_filter
(
install_filters
,
NULL
,
prefix
,
plen
,
src_prefix
,
src_plen
,
NULL
,
ifindex
,
0
,
result
);
src_prefix
,
src_plen
,
NULL
,
ifindex
,
0
,
result
);
if
(
res
<
0
)
res
=
INFINITY
;
return
res
;
}
}
int
int
...
...
disambiguation.c
View file @
73d2c811
...
@@ -215,7 +215,7 @@ is_installed(struct zone *zone)
...
@@ -215,7 +215,7 @@ is_installed(struct zone *zone)
}
}
static
int
static
int
change_route
(
int
operation
,
const
struct
zone
*
zone
,
change_route
(
int
operation
,
struct
zone
*
zone
,
const
struct
babel_route
*
route
,
int
metric
,
const
struct
babel_route
*
route
,
int
metric
,
const
unsigned
char
*
new_next_hop
,
const
unsigned
char
*
new_next_hop
,
int
new_ifindex
,
int
new_metric
)
int
new_ifindex
,
int
new_metric
)
...
@@ -227,8 +227,19 @@ change_route(int operation, const struct zone *zone,
...
@@ -227,8 +227,19 @@ change_route(int operation, const struct zone *zone,
int
m
=
install_filter
(
zone
->
dst_prefix
,
zone
->
dst_plen
,
int
m
=
install_filter
(
zone
->
dst_prefix
,
zone
->
dst_plen
,
zone
->
src_prefix
,
zone
->
src_plen
,
zone
->
src_prefix
,
zone
->
src_plen
,
ifindex
,
&
filter_result
);
ifindex
,
&
filter_result
);
if
(
m
<
INFINITY
)
if
(
m
>=
0
)
{
if
(
m
==
INFINITY
)
return
0
;
if
(
filter_result
.
src_prefix
)
{
if
(
prefix_cmp
(
zone
->
src_prefix
,
zone
->
src_plen
,
filter_result
.
src_prefix
,
filter_result
.
src_plen
)
!=
PST_EQUALS
)
return
0
;
zone
->
src_plen
=
zone
->
src_plen
>=
96
&&
v4mapped
(
zone
->
src_prefix
)
?
96
:
0
;
}
pref_src
=
filter_result
.
pref_src
;
pref_src
=
filter_result
.
pref_src
;
}
int
table
=
filter_result
.
table
?
filter_result
.
table
:
int
table
=
filter_result
.
table
?
filter_result
.
table
:
find_table
(
zone
->
dst_prefix
,
zone
->
dst_plen
,
find_table
(
zone
->
dst_prefix
,
zone
->
dst_plen
,
...
@@ -242,21 +253,21 @@ change_route(int operation, const struct zone *zone,
...
@@ -242,21 +253,21 @@ change_route(int operation, const struct zone *zone,
}
}
static
int
static
int
add_route
(
const
struct
zone
*
zone
,
const
struct
babel_route
*
route
)
add_route
(
struct
zone
*
zone
,
const
struct
babel_route
*
route
)
{
{
return
change_route
(
ROUTE_ADD
,
zone
,
route
,
return
change_route
(
ROUTE_ADD
,
zone
,
route
,
metric_to_kernel
(
route_metric
(
route
)),
NULL
,
0
,
0
);
metric_to_kernel
(
route_metric
(
route
)),
NULL
,
0
,
0
);
}
}
static
int
static
int
del_route
(
const
struct
zone
*
zone
,
const
struct
babel_route
*
route
)
del_route
(
struct
zone
*
zone
,
const
struct
babel_route
*
route
)
{
{
return
change_route
(
ROUTE_FLUSH
,
zone
,
route
,
return
change_route
(
ROUTE_FLUSH
,
zone
,
route
,
metric_to_kernel
(
route_metric
(
route
)),
NULL
,
0
,
0
);
metric_to_kernel
(
route_metric
(
route
)),
NULL
,
0
,
0
);
}
}
static
int
static
int
chg_route
(
const
struct
zone
*
zone
,
const
struct
babel_route
*
old
,
chg_route
(
struct
zone
*
zone
,
const
struct
babel_route
*
old
,
const
struct
babel_route
*
new
)
const
struct
babel_route
*
new
)
{
{
return
change_route
(
ROUTE_MODIFY
,
zone
,
old
,
return
change_route
(
ROUTE_MODIFY
,
zone
,
old
,
...
@@ -266,7 +277,7 @@ chg_route(const struct zone *zone, const struct babel_route *old,
...
@@ -266,7 +277,7 @@ chg_route(const struct zone *zone, const struct babel_route *old,
}
}
static
int
static
int
chg_route_metric
(
const
struct
zone
*
zone
,
const
struct
babel_route
*
route
,
chg_route_metric
(
struct
zone
*
zone
,
const
struct
babel_route
*
route
,
int
old_metric
,
int
new_metric
)
int
old_metric
,
int
new_metric
)
{
{
return
change_route
(
ROUTE_MODIFY
,
zone
,
route
,
return
change_route
(
ROUTE_MODIFY
,
zone
,
route
,
...
...
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