diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-07-04 23:36:21 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-07-04 23:36:21 +0200 |
commit | a1f5e514ef091b82754f38f0e583af40778c7d97 (patch) | |
tree | b449e8da19c061bb4a64857cf29cae9a521cf86f /nest/rt-attr.c | |
parent | 5220cb63e34961b097d3bc274e394c0fa946d7d3 (diff) |
Implement onlink flag for nexthops
Add proper support for per-nexthop onlink flag in routes to handle next
hop addresses that are not covered by interface IP ranges. Supported by
kernel and static protocols.
Thanks to Vincent Bernat for the idea.
Diffstat (limited to 'nest/rt-attr.c')
-rw-r--r-- | nest/rt-attr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/nest/rt-attr.c b/nest/rt-attr.c index 1b7f5836..761ba9fe 100644 --- a/nest/rt-attr.c +++ b/nest/rt-attr.c @@ -171,7 +171,9 @@ nexthop__same(struct nexthop *x, struct nexthop *y) { for (; x && y; x = x->next, y = y->next) { - if (!ipa_equal(x->gw, y->gw) || (x->iface != y->iface) || (x->weight != y->weight) || (x->labels != y->labels)) + if (!ipa_equal(x->gw, y->gw) || (x->iface != y->iface) || + (x->flags != y->flags) || (x->weight != y->weight) || + (x->labels != y->labels)) return 0; for (int i = 0; i < x->labels; i++) @@ -193,6 +195,8 @@ nexthop_compare_node(struct nexthop *x, struct nexthop *y) if (!y) return -1; + /* Should we also compare flags ? */ + r = ((int) y->weight) - ((int) x->weight); if (r) return r; |