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
740e8228
Commit
740e8228
authored
Nov 14, 2013
by
Matthieu Boutier
Committed by
Juliusz Chroboczek
Jul 18, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filter: Rename "result" to "add_metric".
The field "result" is in fact an additional cost.
parent
2c93a100
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
configuration.c
configuration.c
+4
-4
configuration.h
configuration.h
+1
-1
No files found.
configuration.c
View file @
740e8228
...
...
@@ -346,16 +346,16 @@ parse_filter(int c, gnc_t gnc, void *closure, struct filter **filter_return)
filter
->
ifname
=
interface
;
filter
->
ifindex
=
if_nametoindex
(
interface
);
}
else
if
(
strcmp
(
token
,
"allow"
)
==
0
)
{
filter
->
result
=
0
;
filter
->
add_metric
=
0
;
}
else
if
(
strcmp
(
token
,
"deny"
)
==
0
)
{
filter
->
result
=
INFINITY
;
filter
->
add_metric
=
INFINITY
;
}
else
if
(
strcmp
(
token
,
"metric"
)
==
0
)
{
int
metric
;
c
=
getint
(
c
,
&
metric
,
gnc
,
closure
);
if
(
c
<
-
1
)
goto
error
;
if
(
metric
<=
0
||
metric
>
INFINITY
)
goto
error
;
filter
->
result
=
metric
;
filter
->
add_metric
=
metric
;
}
else
{
goto
error
;
}
...
...
@@ -929,7 +929,7 @@ do_filter(struct filter *f, const unsigned char *id,
{
while
(
f
)
{
if
(
filter_match
(
f
,
id
,
prefix
,
plen
,
neigh
,
ifindex
,
proto
))
return
f
->
result
;
return
f
->
add_metric
;
f
=
f
->
next
;
}
return
-
1
;
...
...
configuration.h
View file @
740e8228
...
...
@@ -30,7 +30,7 @@ struct filter {
unsigned
char
plen_ge
,
plen_le
;
unsigned
char
*
neigh
;
int
proto
;
/* May be negative */
unsigned
int
result
;
unsigned
int
add_metric
;
struct
filter
*
next
;
};
...
...
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