summaryrefslogtreecommitdiffstats
path: root/lib/nexthop.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-06-11 18:11:12 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-06-11 18:11:12 +0200
commit18ff3eddccd3b024677bb9b2f9c5aac8df8ecc35 (patch)
tree2897fa8a3bac71f7026b833af457a6d65f865f1c /lib/nexthop.h
parentWhen an interface is disabled, a Cumulus kernel patch causes route deletes to (diff)
downloadfrr-18ff3eddccd3b024677bb9b2f9c5aac8df8ecc35.tar.xz
frr-18ff3eddccd3b024677bb9b2f9c5aac8df8ecc35.zip
Zebra: Don't resolve nexthops over default route unless explicitly allowed.
Ensure that resolution of a nexthop using a default route is not done in the nexthop validation/update code in zebra_rib.c also. This is an addition to the zebra-nht-no-default.patch which made the checks only in the NHT code. In the case of scenarios like interface down, this nexthop update code will kick in first to update the route before the NHT code comes into play; without the additional fix, this code could incorrectly resolve the nexthop over a default route, even when disallowed by the administrator.
Diffstat (limited to 'lib/nexthop.h')
-rw-r--r--lib/nexthop.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/nexthop.h b/lib/nexthop.h
index b375c55b9..e92d97262 100644
--- a/lib/nexthop.h
+++ b/lib/nexthop.h
@@ -85,6 +85,20 @@ struct nexthop
n; \
})
+
+extern int zebra_rnh_ip_default_route;
+extern int zebra_rnh_ipv6_default_route;
+
+static inline int
+nh_resolve_via_default(int family)
+{
+ if (((family == AF_INET) && zebra_rnh_ip_default_route) ||
+ ((family == AF_INET6) && zebra_rnh_ipv6_default_route))
+ return 1;
+ else
+ return 0;
+}
+
extern const char *nexthop_type_to_str (enum nexthop_types_t nh_type);
extern int nexthop_same_no_recurse (struct nexthop *next1, struct nexthop *next2);