summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2022-07-11 16:46:42 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2022-07-11 16:46:42 +0000
commited982cf270158d870719a1e499062d09ee77de7a (patch)
treee91cc46221e2bc518e6c858296334bb4415d5b53
parent9a4ed40dc6f29b34a68366ea8e690e2778a10be0 (diff)
Use newbest and oldbest instead of xp and active as variable names
for the best prefix before and after the decision process. OK tb@
-rw-r--r--usr.sbin/bgpd/rde_decide.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/usr.sbin/bgpd/rde_decide.c b/usr.sbin/bgpd/rde_decide.c
index 6639dcda9da..75614f2ff05 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.94 2022/07/07 19:46:38 claudio Exp $ */
+/* $OpenBSD: rde_decide.c,v 1.95 2022/07/11 16:46:41 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org>
@@ -541,7 +541,7 @@ prefix_best(struct rib_entry *re)
void
prefix_evaluate(struct rib_entry *re, struct prefix *new, struct prefix *old)
{
- struct prefix *xp, *active;
+ struct prefix *newbest, *oldbest;
struct rib *rib;
rib = re_rib(re);
@@ -556,7 +556,7 @@ prefix_evaluate(struct rib_entry *re, struct prefix *new, struct prefix *old)
return;
}
- active = prefix_best(re);
+ oldbest = prefix_best(re);
if (old != NULL)
prefix_remove(old, re);
@@ -564,23 +564,23 @@ prefix_evaluate(struct rib_entry *re, struct prefix *new, struct prefix *old)
if (new != NULL)
prefix_insert(new, NULL, re);
- xp = TAILQ_FIRST(&re->prefix_h);
- if (xp != NULL && !prefix_eligible(xp))
- xp = NULL;
+ newbest = TAILQ_FIRST(&re->prefix_h);
+ if (newbest != NULL && !prefix_eligible(newbest))
+ newbest = NULL;
/*
* If the active prefix changed or the active prefix was removed
* and added again then generate an update.
*/
- if (active != xp || (old != NULL && xp == old)) {
+ if (oldbest != newbest || (old != NULL && newbest == old)) {
/*
- * Send update withdrawing re->active and adding xp
- * but remember that xp may be NULL aka ineligible.
+ * Send update withdrawing oldbest and adding newbest
+ * but remember that newbest may be NULL aka ineligible.
* Additional decision may be made by the called functions.
*/
- rde_generate_updates(rib, xp, active, EVAL_DEFAULT);
+ rde_generate_updates(rib, newbest, oldbest, EVAL_DEFAULT);
if ((rib->flags & F_RIB_NOFIB) == 0)
- rde_send_kroute(rib, xp, active);
+ rde_send_kroute(rib, newbest, oldbest);
return;
}
@@ -591,6 +591,5 @@ prefix_evaluate(struct rib_entry *re, struct prefix *new, struct prefix *old)
*/
if (rde_evaluate_all())
if ((new != NULL && prefix_eligible(new)) || old != NULL)
- rde_generate_updates(rib, prefix_best(re), NULL,
- EVAL_ALL);
+ rde_generate_updates(rib, newbest, NULL, EVAL_ALL);
}