From b96adfd3f8f49175ebb12d34143c3b280c3953d4 Mon Sep 17 00:00:00 2001 From: claudio Date: Mon, 28 Feb 2022 12:52:38 +0000 Subject: [PATCH] In the Adj-RIB-Out specific dump functions assert that PREFIX_FLAG_ADJOUT is set. Similar checks are done for updates and withdraws. OK tb@ --- usr.sbin/bgpd/rde.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index d5f91d8e7d6..e08fec4394e 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.537 2022/02/26 11:48:50 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.538 2022/02/28 12:52:38 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -2574,6 +2574,8 @@ rde_dump_adjout_upcall(struct prefix *p, void *ptr) { struct rde_dump_ctx *ctx = ptr; + if ((p->flags & PREFIX_FLAG_ADJOUT) == 0) + fatalx("%s: prefix without PREFIX_FLAG_ADJOUT hit", __func__); if (p->flags & (PREFIX_FLAG_WITHDRAW | PREFIX_FLAG_DEAD)) return; rde_dump_filter(p, &ctx->req, 1); @@ -2585,6 +2587,8 @@ rde_dump_adjout_prefix_upcall(struct prefix *p, void *ptr) struct rde_dump_ctx *ctx = ptr; struct bgpd_addr addr; + if ((p->flags & PREFIX_FLAG_ADJOUT) == 0) + fatalx("%s: prefix without PREFIX_FLAG_ADJOUT hit", __func__); if (p->flags & (PREFIX_FLAG_WITHDRAW | PREFIX_FLAG_DEAD)) return; -- 2.20.1