From: Igor Ryzhov Date: Wed, 7 Apr 2021 23:14:34 +0000 (+0300) Subject: ospfd: fix crash on "show ip ospf neighbor detail" X-Git-Tag: base_8.0~167^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F8422%2Fhead;p=mirror%2Ffrr.git ospfd: fix crash on "show ip ospf neighbor detail" Fixes #8419. Signed-off-by: Igor Ryzhov --- diff --git a/bgpd/bgp_bfd.c b/bgpd/bgp_bfd.c index f1bdcc8bb4..958d7cf0ed 100644 --- a/bgpd/bgp_bfd.c +++ b/bgpd/bgp_bfd.c @@ -424,8 +424,7 @@ void bgp_bfd_peer_config_write(struct vty *vty, const struct peer *peer, void bgp_bfd_show_info(struct vty *vty, const struct peer *peer, json_object *json_neigh) { - if (peer->bfd_config->session) - bfd_sess_show(vty, json_neigh, peer->bfd_config->session); + bfd_sess_show(vty, json_neigh, peer->bfd_config->session); } DEFUN (neighbor_bfd, diff --git a/lib/bfd.c b/lib/bfd.c index 176269cc5b..276d6c685e 100644 --- a/lib/bfd.c +++ b/lib/bfd.c @@ -988,6 +988,9 @@ void bfd_sess_show(struct vty *vty, struct json_object *json, json_object *json_bfd = NULL; char time_buf[64]; + if (!bsp) + return; + /* Show type. */ if (json) { json_bfd = json_object_new_object();