summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2005-09-21 12:50:21 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2005-09-21 12:50:21 +0000
commitd33e334f6e552e2b92365a9b1c79b61247ec4149 (patch)
treed9a3743f4c62abc1258d47006df620304bee0255 /usr.sbin/bgpd
parent8d1fa756e4d1e0e11c92da78455bfc407dbae480 (diff)
when the route to a nexthop is a reject or blackhole route, the nexthop
is invalid. add check for these flags. shows up with v6, many reject routes there. claudio ok
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r--usr.sbin/bgpd/kroute.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c
index e94679ea1a1..dd36116f6ec 100644
--- a/usr.sbin/bgpd/kroute.c
+++ b/usr.sbin/bgpd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.140 2005/07/01 22:00:04 claudio Exp $ */
+/* $OpenBSD: kroute.c,v 1.141 2005/09/21 12:50:20 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1249,6 +1249,9 @@ kroute_validate(struct kroute *kr)
{
struct kif_node *kif;
+ if (kr->flags & (F_REJECT | F_BLACKHOLE))
+ return (0);
+
if ((kif = kif_find(kr->ifindex)) == NULL) {
if (kr->ifindex)
log_warnx("interface with index %d not found, "
@@ -1266,6 +1269,9 @@ kroute6_validate(struct kroute6 *kr)
{
struct kif_node *kif;
+ if (kr->flags & (F_REJECT | F_BLACKHOLE))
+ return (0);
+
if ((kif = kif_find(kr->ifindex)) == NULL) {
if (kr->ifindex)
log_warnx("interface with index %d not found, "