]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: fix crash on "show ip ospf neighbor detail" 8422/head
authorIgor Ryzhov <iryzhov@nfware.com>
Wed, 7 Apr 2021 23:14:34 +0000 (02:14 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Fri, 9 Apr 2021 08:24:51 +0000 (11:24 +0300)
Fixes #8419.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
bgpd/bgp_bfd.c
lib/bfd.c

index f1bdcc8bb47505fff582b94d328c15868905b97c..958d7cf0ed68d37ca02b5c449fcf636af8fd7315 100644 (file)
@@ -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,
index 176269cc5b2704149d0a9f98289bc813bc4f8165..276d6c685e64c0cd1eebca1e7c07a487dfbcb1ad 100644 (file)
--- 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();