From: claudio Date: Thu, 7 Jul 2022 13:55:52 +0000 (+0000) Subject: Skip dmetric related code for the Adj-RIB-Out since there is no decision X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=17ba980422638374c309625d9b0a2d9953620cbc;p=openbsd Skip dmetric related code for the Adj-RIB-Out since there is no decision process there. OK tb@ --- diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index cd15b875b8d..4a1c5152a1e 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.550 2022/07/07 12:38:19 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.551 2022/07/07 13:55:52 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -2455,27 +2455,29 @@ rde_dump_rib_as(struct prefix *p, struct rde_aspath *asp, pid_t pid, int flags, rib.validation_state = p->validation_state; rib.dmetric = p->dmetric; rib.flags = 0; - re = prefix_re(p); - TAILQ_FOREACH(xp, &re->prefix_h, entry.list.rib) { - switch (xp->dmetric) { - case PREFIX_DMETRIC_BEST: - if (xp == p) - rib.flags |= F_PREF_BEST; - break; - case PREFIX_DMETRIC_ECMP: - if (xp == p) - rib.flags |= F_PREF_ECMP; - break; - case PREFIX_DMETRIC_AS_WIDE: - if (xp == p) - rib.flags |= F_PREF_AS_WIDE; - break; - default: - xp = NULL; /* stop loop */ - break; + if (!adjout) { + re = prefix_re(p); + TAILQ_FOREACH(xp, &re->prefix_h, entry.list.rib) { + switch (xp->dmetric) { + case PREFIX_DMETRIC_BEST: + if (xp == p) + rib.flags |= F_PREF_BEST; + break; + case PREFIX_DMETRIC_ECMP: + if (xp == p) + rib.flags |= F_PREF_ECMP; + break; + case PREFIX_DMETRIC_AS_WIDE: + if (xp == p) + rib.flags |= F_PREF_AS_WIDE; + break; + default: + xp = NULL; /* stop loop */ + break; + } + if (xp == NULL || xp == p) + break; } - if (xp == NULL || xp == p) - break; } if (!peer->conf.ebgp) rib.flags |= F_PREF_INTERNAL;