Index | Thread | Search

From:
Claudio Jeker <cjeker@diehard.n-r-g.com>
Subject:
bgpd: add missing error check for IMSG_RECONF_ROA_ITEM
To:
tech@openbsd.org
Date:
Wed, 12 Nov 2025 17:16:05 +0100

Download raw body.

Thread
Somehow the check for trie_roa_add failure was lost.
We do the same just log the fact handling in IMSG_RECONF_PREFIX_SET_ITEM.
This should only trigger in out of memory situations.

Fixes CID 492365
-- 
:wq Claudio

Index: rde.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/rde.c,v
diff -u -p -r1.662 rde.c
--- rde.c	12 Nov 2025 15:17:43 -0000	1.662
+++ rde.c	12 Nov 2025 15:59:28 -0000
@@ -1144,6 +1144,9 @@ rde_dispatch_imsg_parent(struct imsgbuf 
 			if (imsg_get_data(&imsg, &roa, sizeof(roa)) == -1)
 				fatalx("IMSG_RECONF_ROA_ITEM bad len");
 			rv = trie_roa_add(&last_prefixset->th, &roa);
+			if (rv == -1)
+				log_warnx("trie_roa_add %s failed",
+				    log_roa(&roa));
 			break;
 		case IMSG_RECONF_PREFIX_SET_ITEM:
 			if (imsg_get_data(&imsg, &psi, sizeof(psi)) == -1)