Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
labs
BIRD Internet Routing Daemon
Commits
31e79264
Commit
31e79264
authored
Mar 01, 2000
by
Pavel Machek
Browse files
tmp_attrs fixed.
I do not know if it is right since mj ingores talk once started :-(.
parent
4ebbbd40
Changes
3
Hide whitespace changes
Inline
Side-by-side
filter/config.Y
View file @
31e79264
...
...
@@ -424,7 +424,7 @@ cmd:
}
| UNSET '(' rtadot dynamic_attr ')' ';' {
$$ = $4;
$$->aux =
T_VOID
;
$$->aux =
EAF_TYPE_UNDEF | EAF_INLINE
;
$$->code = P('e','S');
$$->a1.p = NULL;
}
...
...
filter/f-util.c
View file @
31e79264
...
...
@@ -36,7 +36,7 @@ struct f_inst *
f_new_dynamic_attr
(
int
code
)
{
struct
f_inst
*
f
=
f_new_inst
();
f
->
aux
=
T_INT
;
f
->
aux
=
EAF_TYPE_INT
|
EAF_INLINE
;
f
->
a2
.
i
=
code
;
return
f
;
}
...
...
filter/filter.c
View file @
31e79264
...
...
@@ -142,6 +142,7 @@ val_print(struct f_val v)
static
struct
rte
**
f_rte
,
*
f_rte_old
;
static
struct
linpool
*
f_pool
;
static
struct
ea_list
**
f_tmp_attrs
;
#define runtime(x) do { \
log( L_ERR x ); \
...
...
@@ -319,7 +320,8 @@ interpret(struct f_inst *what)
case
P
(
'e'
,
'a'
):
/* Access to extended attributes */
{
eattr
*
e
=
ea_find
(
(
*
f_rte
)
->
attrs
->
eattrs
,
what
->
a2
.
i
);
/* FIXME: should I search in tmp_attrs, too, or what ? */
if
(
!
e
)
e
=
ea_find
(
(
*
f_tmp_attrs
),
what
->
a2
.
i
);
if
(
!
e
)
{
res
.
type
=
T_VOID
;
break
;
...
...
@@ -345,19 +347,28 @@ interpret(struct f_inst *what)
l
->
count
=
1
;
l
->
attrs
[
0
].
id
=
what
->
a2
.
i
;
l
->
attrs
[
0
].
flags
=
0
;
switch
(
what
->
aux
)
{
case
T_INT
:
l
->
attrs
[
0
].
type
=
EAF_TYPE_INT
|
EAF_INLINE
;
l
->
attrs
[
0
].
type
=
what
->
aux
;
switch
(
what
->
aux
&
EAF_TYPE_MASK
)
{
case
EAF_TYPE_INT
:
if
(
v1
.
type
!=
T_INT
)
runtime
(
"Setting int attribute to non-int value"
);
l
->
attrs
[
0
].
u
.
data
=
v1
.
val
.
i
;
break
;
case
T_VOID
:
l
->
attrs
[
0
].
type
=
EAF_TYPE_UNDEF
|
EAF_INLINE
;
case
EAF_TYPE_UNDEF
:
if
(
v1
.
type
!=
T_VOID
)
runtime
(
"Setting void attribute to non-void value"
);
l
->
attrs
[
0
].
u
.
data
=
0
;
break
;
}
*
f_rte
=
rte_do_cow
(
*
f_rte
);
l
->
next
=
(
*
f_rte
)
->
attrs
->
eattrs
;
(
*
f_rte
)
->
attrs
->
eattrs
=
l
;
if
(
what
->
aux
&
EAF_INLINE
)
{
*
f_rte
=
rte_do_cow
(
*
f_rte
);
l
->
next
=
(
*
f_rte
)
->
attrs
->
eattrs
;
(
*
f_rte
)
->
attrs
->
eattrs
=
l
;
}
else
{
l
->
next
=
(
*
f_tmp_attrs
);
(
*
f_tmp_attrs
)
=
l
;
}
}
break
;
...
...
@@ -494,8 +505,6 @@ i_same(struct f_inst *f1, struct f_inst *f2)
return
i_same
(
f1
->
next
,
f2
->
next
);
}
/* FIXME: tmp_attrs is unreferenced. That can't be right.
Strange. look at eS how dynamic attrs are set. */
int
f_run
(
struct
filter
*
filter
,
struct
rte
**
rte
,
struct
ea_list
**
tmp_attrs
,
struct
linpool
*
tmp_pool
)
{
...
...
@@ -503,6 +512,7 @@ f_run(struct filter *filter, struct rte **rte, struct ea_list **tmp_attrs, struc
struct
f_val
res
;
debug
(
"Running filter `%s'..."
,
filter
->
name
);
f_tmp_attrs
=
tmp_attrs
;
f_rte
=
rte
;
f_rte_old
=
*
rte
;
f_pool
=
tmp_pool
;
...
...
Write
Preview
Supports
Markdown
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