summaryrefslogtreecommitdiff
path: root/filter/f-inst.c
diff options
context:
space:
mode:
Diffstat (limited to 'filter/f-inst.c')
-rw-r--r--filter/f-inst.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/filter/f-inst.c b/filter/f-inst.c
index 2d2a30e4..e4b47ff4 100644
--- a/filter/f-inst.c
+++ b/filter/f-inst.c
@@ -694,6 +694,7 @@
case SA_WEIGHT: RESULT(sa.f_type, i, rta->nh.weight + 1); break;
case SA_PREF: RESULT(sa.f_type, i, rta->pref); break;
case SA_GW_MPLS: RESULT(sa.f_type, i, rta->nh.labels ? rta->nh.label[0] : MPLS_NULL); break;
+ case SA_ONLINK: RESULT(sa.f_type, i, rta->nh.flags & RNF_ONLINK ? 1 : 0); break;
default:
bug("Invalid static attribute access (%u/%u)", sa.f_type, sa.sa_code);
@@ -720,8 +721,8 @@
case SA_GW:
{
ip_addr ip = v1.val.ip;
- struct iface *ifa = ipa_is_link_local(ip) ? rta->nh.iface : NULL;
- neighbor *n = neigh_find((*fs->rte)->src->proto, ip, ifa, 0);
+ struct iface *ifa = ipa_is_link_local(ip) || (rta->nh.flags & RNF_ONLINK) ? rta->nh.iface : NULL;
+ neighbor *n = neigh_find((*fs->rte)->src->proto, ip, ifa, (rta->nh.flags & RNF_ONLINK) ? NEF_ONLINK : 0);
if (!n || (n->scope == SCOPE_HOST))
runtime( "Invalid gw address" );
@@ -801,6 +802,15 @@
rta->pref = v1.val.i;
break;
+ case SA_ONLINK:
+ {
+ if (v1.val.i)
+ rta->nh.flags |= RNF_ONLINK;
+ else
+ rta->nh.flags &= ~RNF_ONLINK;
+ }
+ break;
+
default:
bug("Invalid static attribute access (%u/%u)", sa.f_type, sa.sa_code);
}