Signed-off-by: Christian Franke <[email protected]>
---
> Maybe related, see Timo's approach of setting scope to
> RT_SCOPE_LINK instead
I don't think that this is a sufficient solution. While it might be
useful to set scope link on routes to make them usable by other
applications, there are cases where routes with a gateway need to be
installed both a) without an interface route being present and b)
with an interface route by another application being present that
doesn't set scope link.
Unless someone can come up with a case where setting the onlink flag,
as done in this patch, causes any issues, I don't see a reason not to
do it that way.
-Christian
zebra/zebra_rib.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 084af38..a214b7a 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -363,6 +363,11 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop
*nexthop, int set,
nexthop->resolved = NULL;
}
+ if (nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX) {
+ nexthop->flags |= NEXTHOP_FLAG_ONLINK;
+ return 1;
+ }
+
/* Make lookup prefix. */
memset (&p, 0, sizeof (struct prefix_ipv4));
p.family = AF_INET;
@@ -505,6 +510,11 @@ nexthop_active_ipv6 (struct rib *rib, struct nexthop
*nexthop, int set,
nexthop->resolved = NULL;
}
+ if (nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX) {
+ nexthop->flags |= NEXTHOP_FLAG_ONLINK;
+ return 1;
+ }
+
/* Make lookup prefix. */
memset (&p, 0, sizeof (struct prefix_ipv6));
p.family = AF_INET6;
--
2.4.0
_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev