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
f9b504b7
Commit
f9b504b7
authored
May 04, 2022
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix handling of install deny filters.
parent
b72202d9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
13 deletions
+28
-13
CHANGES
CHANGES
+1
-0
configuration.c
configuration.c
+17
-7
route.c
route.c
+10
-6
No files found.
CHANGES
View file @
f9b504b7
...
...
@@ -6,6 +6,7 @@ babeld-1.12 (unreleased)
Thanks to Toke Høyland-Jørgensen.
* Fix restoring of interface configuration to avoid unbounded memory
consumption. Thanks to andrew-hoff.
* Fix handling of deny filters in the install chain.
30 March 2022: babeld-1.11
...
...
configuration.c
View file @
f9b504b7
...
...
@@ -1549,14 +1549,24 @@ install_filter(const unsigned char *prefix, unsigned short plen,
int
finalise_config
()
{
struct
filter
*
filter
=
calloc
(
1
,
sizeof
(
struct
filter
));
if
(
filter
==
NULL
)
return
-
1
;
struct
filter
*
filter1
,
*
filter2
;
filter
->
proto
=
RTPROT_BABEL_LOCAL
;
filter
->
plen_le
=
128
;
filter
->
src_plen_le
=
128
;
add_filter
(
filter
,
FILTER_TYPE_REDISTRIBUTE
);
/* redistribute local allow */
filter1
=
calloc
(
1
,
sizeof
(
struct
filter
));
if
(
filter1
==
NULL
)
return
-
1
;
filter1
->
proto
=
RTPROT_BABEL_LOCAL
;
filter1
->
plen_le
=
128
;
filter1
->
src_plen_le
=
128
;
add_filter
(
filter1
,
FILTER_TYPE_REDISTRIBUTE
);
/* install allow */
filter2
=
calloc
(
1
,
sizeof
(
struct
filter
));
if
(
filter2
==
NULL
)
return
-
1
;
filter2
->
plen_le
=
128
;
filter2
->
src_plen_le
=
128
;
add_filter
(
filter2
,
FILTER_TYPE_INSTALL
);
while
(
interface_confs
)
{
struct
interface_conf
*
if_conf
;
...
...
route.c
View file @
f9b504b7
...
...
@@ -446,14 +446,18 @@ change_route(int operation, const struct babel_route *route, int metric,
struct
filter_result
filter_result
;
unsigned
char
*
pref_src
=
NULL
;
unsigned
int
ifindex
=
route
->
neigh
->
ifp
->
ifindex
;
int
m
,
table
;
int
m
=
install_filter
(
route
->
src
->
prefix
,
route
->
src
->
plen
,
m
=
install_filter
(
route
->
src
->
prefix
,
route
->
src
->
plen
,
route
->
src
->
src_prefix
,
route
->
src
->
src_plen
,
ifindex
,
&
filter_result
);
if
(
m
<
INFINITY
)
pref_src
=
filter_result
.
pref_src
;
if
(
m
>=
INFINITY
&&
operation
==
ROUTE_ADD
)
{
errno
=
EPERM
;
return
-
1
;
}
int
table
=
filter_result
.
table
?
filter_result
.
table
:
export_table
;
pref_src
=
filter_result
.
pref_src
;
table
=
filter_result
.
table
?
filter_result
.
table
:
export_table
;
return
kernel_route
(
operation
,
table
,
route
->
src
->
prefix
,
route
->
src
->
plen
,
route
->
src
->
src_prefix
,
route
->
src
->
src_plen
,
pref_src
,
...
...
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