summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
Diffstat (limited to 'filter')
-rw-r--r--filter/config.Y2
-rw-r--r--filter/filter.c14
2 files changed, 15 insertions, 1 deletions
diff --git a/filter/config.Y b/filter/config.Y
index 93ad8d8b..d865d11f 100644
--- a/filter/config.Y
+++ b/filter/config.Y
@@ -852,7 +852,7 @@ static_attr:
| SOURCE { $$ = f_new_static_attr(T_ENUM_RTS, SA_SOURCE, 0); }
| SCOPE { $$ = f_new_static_attr(T_ENUM_SCOPE, SA_SCOPE, 1); }
| DEST { $$ = f_new_static_attr(T_ENUM_RTD, SA_DEST, 1); }
- | IFNAME { $$ = f_new_static_attr(T_STRING, SA_IFNAME, 0); }
+ | IFNAME { $$ = f_new_static_attr(T_STRING, SA_IFNAME, 1); }
| IFINDEX { $$ = f_new_static_attr(T_INT, SA_IFINDEX, 0); }
;
diff --git a/filter/filter.c b/filter/filter.c
index edf54ec0..f308e7fd 100644
--- a/filter/filter.c
+++ b/filter/filter.c
@@ -1002,6 +1002,20 @@ interpret(struct f_inst *what)
rta->hostentry = NULL;
break;
+ case SA_IFNAME:
+ {
+ struct iface *ifa = if_find_by_name(v1.val.s);
+ if (!ifa)
+ runtime( "Invalid iface name" );
+
+ rta->dest = RTD_UNICAST;
+ rta->nh.gw = IPA_NONE;
+ rta->nh.iface = ifa;
+ rta->nh.next = NULL;
+ rta->hostentry = NULL;
+ }
+ break;
+
default:
bug("Invalid static attribute access (%x)", res.type);
}