summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2004-01-07 01:58:56 +0000
committerhenning <henning@openbsd.org>2004-01-07 01:58:56 +0000
commite86c15a4e2d098b1b5d5fc8005eb1565a23e8917 (patch)
treebafc331dfd9af9f893ebf5e9a9b98f7db85e3520
parenthandle global vs peer-specific holdtime in a nicer and reload-friendlier (diff)
downloadwireguard-openbsd-e86c15a4e2d098b1b5d5fc8005eb1565a23e8917.tar.xz
wireguard-openbsd-e86c15a4e2d098b1b5d5fc8005eb1565a23e8917.zip
don't ever send kroute change (that includes add) requests to the parent
where the nexthop is not in state NEXTHOP_REACH. previously routes in state NEXTHOP_LOOKUP, i. e. not yet verified, were send to the parent process causing unnecessary and of course failing route add attempts, cluttering logs, etc. nexthops in state NEXTHOP_UNREACH were handled correctly.
-rw-r--r--usr.sbin/bgpd/rde.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index abe07e9139c..2ef49c1a800 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.48 2004/01/07 00:01:16 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.49 2004/01/07 01:58:56 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -591,6 +591,8 @@ rde_send_kroute(struct prefix *new, struct prefix *old)
} else {
type = IMSG_KROUTE_CHANGE;
p = new;
+ if (new->aspath->nexthop->state != NEXTHOP_REACH)
+ return;
kr.nexthop = p->aspath->nexthop->true_nexthop.s_addr;
}