]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: Fix crash for `show bgp ... neighbor received-routes detail|PREFIX`
authorDonatas Abraitis <donatas@opensourcerouting.org>
Thu, 13 Apr 2023 20:37:06 +0000 (23:37 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Thu, 13 Apr 2023 20:37:06 +0000 (23:37 +0300)
BGP: Received signal 11 at 1681287514 (si_addr 0x8, PC 0x559ab42eb1d9); aborting...
BGP: /lib/libfrr.so.0(zlog_backtrace_sigsafe+0x71) [0x7f4356b19af1]
BGP: /lib/libfrr.so.0(zlog_signal+0xf9) [0x7f4356b19cf9]
BGP: /lib/libfrr.so.0(+0xf5af5) [0x7f4356b4baf5]
BGP: /lib/x86_64-linux-gnu/libpthread.so.0(+0x14420) [0x7f43568ab420]
BGP: /usr/lib/frr/bgpd(prefix_rd2str+0x29) [0x559ab42eb1d9]
BGP: /usr/lib/frr/bgpd(route_vty_out_detail_header+0x7ca) [0x559ab43061ba]
BGP: /usr/lib/frr/bgpd(+0x1771a6) [0x559ab430a1a6]
BGP: /usr/lib/frr/bgpd(+0x177f06) [0x559ab430af06]
BGP: /usr/lib/frr/bgpd(+0x178c8b) [0x559ab430bc8b]
BGP: /usr/lib/frr/bgpd(+0x179e7e) [0x559ab430ce7e]
BGP: /lib/libfrr.so.0(+0x9417e) [0x7f4356aea17e]
BGP: /lib/libfrr.so.0(cmd_execute_command+0x111) [0x7f4356aea321]
BGP: /lib/libfrr.so.0(cmd_execute+0xd0) [0x7f4356aea4c0]
BGP: /lib/libfrr.so.0(+0x10d5de) [0x7f4356b635de]
BGP: /lib/libfrr.so.0(+0x10d81d) [0x7f4356b6381d]
BGP: /lib/libfrr.so.0(+0x110b03) [0x7f4356b66b03]
BGP: /lib/libfrr.so.0(event_call+0x81) [0x7f4356b5df91]
BGP: /lib/libfrr.so.0(frr_run+0xe8) [0x7f4356b11b58]
BGP: /usr/lib/frr/bgpd(main+0x385) [0x559ab4281d55]
BGP: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f43566c9083]
BGP: /usr/lib/frr/bgpd(_start+0x2e) [0x559ab428437e]
BGP: in thread vtysh_read scheduled from lib/vty.c:2833 vty_event()

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd/bgp_route.c

index 91fb0c7801ab2f8b0e9bae294642c760ed1aa895..65f7ce16438ef00f278167af198d9ae1381c7368 100644 (file)
@@ -11904,12 +11904,14 @@ void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
                        vty_out(vty,
                                "BGP routing table entry for %s%s%pFX, version %" PRIu64
                                "\n",
-                               ((safi == SAFI_MPLS_VPN || safi == SAFI_ENCAP)
+                               (((safi == SAFI_MPLS_VPN ||
+                                  safi == SAFI_ENCAP) &&
+                                 prd)
                                         ? prefix_rd2str(prd, buf1,
                                                         sizeof(buf1),
                                                         bgp->asnotation)
                                         : ""),
-                               safi == SAFI_MPLS_VPN ? ":" : "", p,
+                               safi == SAFI_MPLS_VPN && prd ? ":" : "", p,
                                dest->version);
 
                } else {