summaryrefslogtreecommitdiff
path: root/proto/static
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2024-02-16 18:44:40 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2024-02-16 18:44:40 +0100
commitc3335b504403136ef8deb81cb034480a65ca2815 (patch)
treec63e160e1ce983154bb082d107f93617ab329314 /proto/static
parent5c04f0e2354ff0cca9b1479e68882b72755f3aab (diff)
Static: Allow to define both nexthop and interface
Allow to define both nexthop and interface using iproute2-like syntax, e.g.: route 10.0.0.0/16 via 10.1.0.1 dev "eth0"; Now we can avoid to use link-local scope hack (e.g. 10.1.0.1%eth0) for cases where both nexthop and interface have to be defined. Thanks to Marcin Saklak for the suggestion.
Diffstat (limited to 'proto/static')
-rw-r--r--proto/static/config.Y3
1 files changed, 3 insertions, 0 deletions
diff --git a/proto/static/config.Y b/proto/static/config.Y
index 215681e8..e746b63c 100644
--- a/proto/static/config.Y
+++ b/proto/static/config.Y
@@ -87,6 +87,9 @@ stat_nexthop:
this_snh->via = IPA_NONE;
this_snh->iface = if_get_by_name($2);
}
+ | stat_nexthop DEV TEXT {
+ this_snh->iface = if_get_by_name($3);
+ }
| stat_nexthop MPLS label_stack {
this_snh->mls = $3;
}