From: Donald Sharp Date: Tue, 15 Nov 2016 00:54:36 +0000 (-0500) Subject: pimd: Fix crash in pim_rp_show_information X-Git-Tag: frr-3.0-branchpoint~64^2~10^2~93 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=3440bd157353d67808eb77cd9045b730900a21d5;p=matthieu%2Ffrr.git pimd: Fix crash in pim_rp_show_information 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 --- diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c index 1bd48798c6..abc06b4eff 100644 --- a/pimd/pim_rp.c +++ b/pimd/pim_rp.c @@ -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);