Hello BIRD team!

This simple patch (for branch master) adds a space between the AS number and 
the route origin in show route output, I think this improves readability.

Example, current BIRD:
    10.0.0.0/8          unicast [blabla] * (100/210) [AS12322i]
And with the patch:
    10.0.0.0/8          unicast [blabla] * (100/210) [AS12322 i]

Thanks!
--
Sébastien
From ce511260643ea0eed1328cb9bf8dd6abc351532c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Parisot?= <[email protected]>
Date: Tue, 12 Aug 2025 14:37:12 +0200
Subject: [PATCH] BGP: Added a space between origin AS and origin to improve
 readability in show route output

---
 proto/bgp/attrs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index e853624b..661437e0 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -2501,7 +2501,11 @@ bgp_get_route_info(rte *e, byte *buf)
   buf += bsprintf(buf, ") [");
 
   if (p && as_path_get_last(p->u.ptr, &origas))
+  {
     buf += bsprintf(buf, "AS%u", origas);
+    if (o)
+      strcpy(buf, " ");
+  }
   if (o)
     buf += bsprintf(buf, "%c", "ie?"[o->u.data]);
   strcpy(buf, "]");
-- 
2.39.5

Reply via email to