Index | Thread | Search

From:
Claudio Jeker <cjeker@diehard.n-r-g.com>
Subject:
bgpd: handle rib "Adj-RIB-Out" in show commands
To:
tech@openbsd.org
Date:
Mon, 2 Dec 2024 16:42:12 +0100

Download raw body.

Thread
The Adj-RIB-Out unlike Adj-RIB-In does not exists in bgpd.
Because of this
	bgpctl show rib table Adj-RIB-In
works but
	bgpctl show rib table Adj-RIB-Out
fails.

I think it makes sense to add this little "hack" to also support the
latter.
-- 
:wq Claudio

Index: rde.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/rde.c,v
diff -u -p -r1.642 rde.c
--- rde.c	2 Dec 2024 15:03:17 -0000	1.642
+++ rde.c	2 Dec 2024 15:37:32 -0000
@@ -3013,6 +3013,9 @@ rde_dump_ctx_new(struct ctl_show_rib_req
 		return;
 	}
 
+	if (strcmp(req->rib, "Adj-RIB-Out") == 0)
+		req->flags |= F_CTL_ADJ_OUT;
+
 	memcpy(&ctx->req, req, sizeof(struct ctl_show_rib_request));
 	ctx->req.pid = pid;
 	ctx->req.type = type;