diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2022-02-28 12:52:39 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2022-02-28 12:52:39 +0000 |
commit | a12e6587d4ef439836e53dd5d0e351c3ae573240 (patch) | |
tree | 88fa73ba0dcf5de8d012cce9e6cc2b341358f163 | |
parent | 531b74ecc74f743a695870982169dbfd3758e7d9 (diff) |
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@
-rw-r--r-- | usr.sbin/bgpd/rde.c | 6 |
1 files changed, 5 insertions, 1 deletions
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 <henning@openbsd.org> @@ -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; |