summaryrefslogtreecommitdiffstats
path: root/filter/filter.c
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>2000-05-30 12:42:39 +0200
committerPavel Machek <pavel@ucw.cz>2000-05-30 12:42:39 +0200
commit26c09e1d25abff7fb88959dc6fbaa7ae5eb295ad (patch)
tree2a309ee61845f91be7f9f4d58d88246fb64f1278 /filter/filter.c
parent2d6627a7a5e52f8314520f9aefd82040e24849cb (diff)
downloadbird-26c09e1d25abff7fb88959dc6fbaa7ae5eb295ad.tar
bird-26c09e1d25abff7fb88959dc6fbaa7ae5eb295ad.zip
Added read-only access to all required fields in rta.
Diffstat (limited to 'filter/filter.c')
-rw-r--r--filter/filter.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/filter/filter.c b/filter/filter.c
index 246fbf6..e69e9e1 100644
--- a/filter/filter.c
+++ b/filter/filter.c
@@ -200,6 +200,18 @@ static struct ea_list **f_tmp_attrs;
static int f_flags;
static rta *f_rta_copy;
+void
+rta_cow(void)
+{
+ if (!f_rta_copy) {
+ f_rta_copy = lp_alloc(f_pool, sizeof(rta));
+ memcpy(f_rta_copy, (*f_rte)->attrs, sizeof(rta));
+ f_rta_copy->aflags = 0;
+ *f_rte = rte_cow(*f_rte);
+ (*f_rte)->attrs = f_rta_copy;
+ }
+}
+
#define runtime(x) do { \
log( L_ERR "filters, line %d: %s", what->lineno, x); \
res.type = T_RETURN; \
@@ -477,13 +489,7 @@ interpret(struct f_inst *what)
}
if (!(what->aux & EAF_TEMP) && (!(f_flags & FF_FORCE_TMPATTR))) {
- if (!f_rta_copy) {
- f_rta_copy = lp_alloc(f_pool, sizeof(rta));
- memcpy(f_rta_copy, (*f_rte)->attrs, sizeof(rta));
- f_rta_copy->aflags = 0;
- *f_rte = rte_cow(*f_rte);
- (*f_rte)->attrs = f_rta_copy;
- }
+ rta_cow();
l->next = f_rta_copy->eattrs;
f_rta_copy->eattrs = l;
} else {