summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2016-01-15 16:36:30 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-09-23 15:51:56 +0200
commit72f3a8fb09433ee1e4d079522cd70999bb3b8e79 (patch)
tree08defc193d9f6429a87a085ca878b25bd4bf700b /zebra/zebra_rib.c
parentMake route flags a 32bit field (diff)
downloadfrr-72f3a8fb09433ee1e4d079522cd70999bb3b8e79.tar.xz
frr-72f3a8fb09433ee1e4d079522cd70999bb3b8e79.zip
zebra: use link scope for interface routes
In linux, 'scope' is a hint of distance of the IP. And this is evident from the fact that only lower scope can be used as recursive via lookup result. This changes all interface routes scope to link so kernel will allow regular routes to use it as via. Then we do not need to use the 'onlink' attribute. Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Diffstat (limited to '')
-rw-r--r--zebra/zebra_rib.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index f57c0b5d6..775619ac2 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -483,27 +483,16 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set,
{
resolved_hop->type = newhop->type;
resolved_hop->gate.ipv4 = newhop->gate.ipv4;
-
- if (newhop->ifindex)
- {
- resolved_hop->type = NEXTHOP_TYPE_IPV4_IFINDEX;
- resolved_hop->ifindex = newhop->ifindex;
- if (newhop->flags & NEXTHOP_FLAG_ONLINK)
- resolved_hop->flags |= NEXTHOP_FLAG_ONLINK;
- }
+ resolved_hop->ifindex = newhop->ifindex;
}
- /* If the resolving route is an interface route,
- * it means the gateway we are looking up is connected
- * to that interface. (The actual network is _not_ onlink).
- * Therefore, the resolved route should have the original
- * gateway as nexthop as it is directly connected.
- *
- * On Linux, we have to set the onlink netlink flag because
- * otherwise, the kernel won't accept the route. */
+ /* If the resolving route is an interface route, it
+ * means the gateway we are looking up is connected
+ * to that interface. Therefore, the resolved route
+ * should have the original gateway as nexthop as it
+ * is directly connected. */
if (newhop->type == NEXTHOP_TYPE_IFINDEX)
{
- resolved_hop->flags |= NEXTHOP_FLAG_ONLINK;
resolved_hop->type = NEXTHOP_TYPE_IPV4_IFINDEX;
resolved_hop->gate.ipv4 = nexthop->gate.ipv4;
resolved_hop->ifindex = newhop->ifindex;