summaryrefslogtreecommitdiff
path: root/filter/filter.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2012-04-29 01:35:52 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2012-04-29 01:35:52 +0200
commit182a78957d60a4c91c1ff8d1ff0f09b1b64b70ba (patch)
tree9a9dfd310af1a1465fd022b7bc547d42d7674803 /filter/filter.c
parentbf42207332e8e502d636038f1ec44aaea6ec50e0 (diff)
Allows some modifications of dest attribute in filters.
Diffstat (limited to 'filter/filter.c')
-rw-r--r--filter/filter.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/filter/filter.c b/filter/filter.c
index acdcfd2b..49b67391 100644
--- a/filter/filter.c
+++ b/filter/filter.c
@@ -852,12 +852,25 @@ interpret(struct f_inst *what)
{
struct rta *rta = (*f_rte)->attrs;
switch (what->aux) {
- case T_ENUM:
- * ((char *) rta + what->a2.i) = v1.val.i;
- break;
+
case T_IP:
* (ip_addr *) ((char *) rta + what->a2.i) = v1.val.px.ip;
break;
+
+ case T_ENUM_SCOPE:
+ rta->scope = v1.val.i;
+ break;
+
+ case T_ENUM_RTD:
+ i = v1.val.i;
+ if ((i != RTD_BLACKHOLE) && (i != RTD_UNREACHABLE) && (i != RTD_PROHIBIT))
+ runtime( "Destination can be changed only to blackhole, unreachable or prohibit" );
+ rta->dest = i;
+ rta->gw = IPA_NONE;
+ rta->iface = NULL;
+ rta->nexthops = NULL;
+ break;
+
default:
bug( "Unknown type in set of static attribute" );
}