diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2004-01-07 00:01:18 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2004-01-07 00:01:18 +0000 |
commit | 616d74e2df3d16001482c05794db38a5c827e53f (patch) | |
tree | 042d203c2191999539f7bcf882729ac9a4fef691 /usr.sbin | |
parent | 489a1ef4bb9c841ff52b6b3cf87d0054b6dd7a25 (diff) |
Make sure that kroute updates for the FIB are only sent if there is a
change. Until now rde_send_kroute tried to send a IMSG_KROUTE_DELETE if old
and new prefix where ineligible. OK henning@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpd/rde.c | 7 | ||||
-rw-r--r-- | usr.sbin/bgpd/rde_decide.c | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 6ecb5713403..abe07e9139c 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.47 2004/01/06 03:43:50 henning Exp $ */ +/* $OpenBSD: rde.c,v 1.48 2004/01/07 00:01:16 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -577,7 +577,10 @@ rde_send_kroute(struct prefix *new, struct prefix *old) struct prefix *p; enum imsg_type type; - if (old == NULL && new == NULL) + if ((old == NULL || old->aspath->nexthop == NULL || + old->aspath->nexthop->state == NEXTHOP_UNREACH) && + (new == NULL || new->aspath->nexthop == NULL || + new->aspath->nexthop->state == NEXTHOP_UNREACH)) return; if (new == NULL || new->aspath->nexthop == NULL || diff --git a/usr.sbin/bgpd/rde_decide.c b/usr.sbin/bgpd/rde_decide.c index a80b86dd724..77adf20beb9 100644 --- a/usr.sbin/bgpd/rde_decide.c +++ b/usr.sbin/bgpd/rde_decide.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_decide.c,v 1.10 2004/01/06 10:51:14 claudio Exp $ */ +/* $OpenBSD: rde_decide.c,v 1.11 2004/01/07 00:01:17 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> @@ -216,9 +216,7 @@ prefix_evaluate(struct prefix *p, struct pt_entry *pte) * has an unreachable nexthop */ - if (!(xp != NULL && xp->aspath->nexthop != NULL && - xp->aspath->nexthop->state != NEXTHOP_REACH)) - rde_send_kroute(xp, pte->active); + rde_send_kroute(xp, pte->active); if (xp == NULL || xp->aspath->nexthop == NULL || xp->aspath->nexthop->state != NEXTHOP_REACH) |