]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Fix crash in pim_rp_show_information
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 15 Nov 2016 00:54:36 +0000 (19:54 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:15 +0000 (20:26 -0500)
When a 'show ip pim rp-info' is issued shortly
after a restart/start, pim will crash because
nexthop information has not been fully resolved
and the outgoing interface is NULL.

Ticket: CM-13567
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_rp.c

index 1bd48798c65458860431612cda888305e0b68b43..abc06b4eff4c8b13f96609f0990a1d6bf8f3d57f 100644 (file)
@@ -734,7 +734,8 @@ pim_rp_show_information (struct vty *vty, u_char uj)
                   json_rp_rows = json_object_new_array();
 
               json_row = json_object_new_object();
-              json_object_string_add(json_row, "outboundInterface", rp_info->rp.source_nexthop.interface->name);
+             if (rp_info->rp.source_nexthop.interface)
+               json_object_string_add(json_row, "outboundInterface", rp_info->rp.source_nexthop.interface->name);
 
               if (rp_info->i_am_rp)
                 json_object_boolean_true_add(json_row, "iAmRP");
@@ -755,7 +756,10 @@ pim_rp_show_information (struct vty *vty, u_char uj)
               else
                 vty_out (vty, "%-18s  ", prefix2str(&rp_info->group, buf, 48));
 
-              vty_out (vty, "%-10s  ", rp_info->rp.source_nexthop.interface->name);
+             if (rp_info->rp.source_nexthop.interface)
+               vty_out (vty, "%-10s  ", rp_info->rp.source_nexthop.interface->name);
+             else
+               vty_out (vty, "%-10s  ", "(Unknown)");
 
               if (rp_info->i_am_rp)
                 vty_out (vty, "yes%s", VTY_NEWLINE);