mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
Allows some modifications of dest attribute in filters.
This commit is contained in:
@@ -703,7 +703,7 @@ static_attr:
|
||||
| SOURCE { $$ = f_new_inst(); $$->aux = T_ENUM_RTS; $$->a2.i = OFFSETOF(struct rta, source); }
|
||||
| SCOPE { $$ = f_new_inst(); $$->aux = T_ENUM_SCOPE; $$->a2.i = OFFSETOF(struct rta, scope); $$->a1.i = 1; }
|
||||
| CAST { $$ = f_new_inst(); $$->aux = T_ENUM_RTC; $$->a2.i = OFFSETOF(struct rta, cast); }
|
||||
| DEST { $$ = f_new_inst(); $$->aux = T_ENUM_RTD; $$->a2.i = OFFSETOF(struct rta, dest); }
|
||||
| DEST { $$ = f_new_inst(); $$->aux = T_ENUM_RTD; $$->a2.i = OFFSETOF(struct rta, dest); $$->a1.i = 1; }
|
||||
;
|
||||
|
||||
term:
|
||||
|
@@ -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" );
|
||||
}
|
||||
|
Reference in New Issue
Block a user