From: claudio Date: Tue, 1 Mar 2022 09:38:06 +0000 (+0000) Subject: Reshuffle functions for better order and remove an excessive empty line. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=05c83d2ba8718df05b3971eb6856079f3bdcd231;p=openbsd Reshuffle functions for better order and remove an excessive empty line. --- diff --git a/usr.sbin/bgpd/rde_rib.c b/usr.sbin/bgpd/rde_rib.c index 1d57fbcfd83..2fd1628c72d 100644 --- a/usr.sbin/bgpd/rde_rib.c +++ b/usr.sbin/bgpd/rde_rib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_rib.c,v 1.228 2022/02/28 14:32:01 claudio Exp $ */ +/* $OpenBSD: rde_rib.c,v 1.229 2022/03/01 09:38:06 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker @@ -1284,24 +1284,6 @@ prefix_adjout_withdraw(struct rde_peer *peer, struct bgpd_addr *prefix, return (1); } -static struct prefix * -prefix_restart(struct rib_context *ctx) -{ - struct prefix *p; - - p = prefix_unlock(ctx->ctx_p); - - if (prefix_is_dead(p)) { - struct prefix *next; - - next = RB_NEXT(prefix_index, unused, p); - prefix_adjout_destroy(p); - p = next; - } - ctx->ctx_p = NULL; - return p; -} - void prefix_adjout_destroy(struct prefix *p) { @@ -1327,7 +1309,6 @@ prefix_adjout_destroy(struct prefix *p) /* nothing needs to be done for PREFIX_FLAG_DEAD and STALE */ p->flags &= ~PREFIX_FLAG_MASK; - if (prefix_is_locked(p)) { /* mark prefix dead but leave it for prefix_restart */ p->flags |= PREFIX_FLAG_DEAD; @@ -1339,6 +1320,24 @@ prefix_adjout_destroy(struct prefix *p) } } +static struct prefix * +prefix_restart(struct rib_context *ctx) +{ + struct prefix *p; + + p = prefix_unlock(ctx->ctx_p); + + if (prefix_is_dead(p)) { + struct prefix *next; + + next = RB_NEXT(prefix_index, unused, p); + prefix_adjout_destroy(p); + p = next; + } + ctx->ctx_p = NULL; + return p; +} + static void prefix_dump_r(struct rib_context *ctx) {