-/* $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 <claudio@openbsd.org>
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)
{
/* 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;
}
}
+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)
{