summaryrefslogtreecommitdiff
path: root/pimd/pim_cmd.c
diff options
context:
space:
mode:
authorSarita Patra <saritap@vmware.com>2019-02-22 01:47:58 -0800
committerSarita Patra <saritap@vmware.com>2019-02-24 09:38:03 -0800
commitd8bed89dca5955fe298c108afe78b13a95469cea (patch)
tree363a097a1eef9bbf9afad5bcd3895121dd9bfef0 /pimd/pim_cmd.c
parentbbe598df214486db57a0fd72a3c9875c0dfc2006 (diff)
pimd: Handling dummy upstream in "show ip pim upstream"
When FRR receives IGMP/PIM (*, G) join and RP is not configured or not reachable, then we are creating a dummy upstream with incoming interface as NULL. Added some null checks for the incoming interface, while displaying the pim upstream information in the cli command "show ip pim upstream". Signed-off-by: Sarita Patra <saritap@vmware.com>
Diffstat (limited to 'pimd/pim_cmd.c')
-rw-r--r--pimd/pim_cmd.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index 193eddf68a..2d4c237d0f 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -2370,9 +2370,10 @@ static void pim_show_upstream(struct pim_instance *pim, struct vty *vty,
up->t_join_timer);
/*
- * If we have a J/P timer for the neighbor display that
+ * If the upstream is not dummy and it has a J/P timer for the
+ * neighbor display that
*/
- if (!up->t_join_timer) {
+ if (!up->t_join_timer && up->rpf.source_nexthop.interface) {
struct pim_neighbor *nbr;
nbr = pim_neighbor_find(
@@ -2412,8 +2413,10 @@ static void pim_show_upstream(struct pim_instance *pim, struct vty *vty,
json_row = json_object_new_object();
json_object_pim_upstream_add(json_row, up);
json_object_string_add(
- json_row, "inboundInterface",
- up->rpf.source_nexthop.interface->name);
+ json_row, "inboundInterface",
+ up->rpf.source_nexthop.interface
+ ? up->rpf.source_nexthop.interface->name
+ : "Unknown");
/*
* The RPF address we use is slightly different
@@ -2463,8 +2466,10 @@ static void pim_show_upstream(struct pim_instance *pim, struct vty *vty,
} else {
vty_out(vty,
"%-10s%-15s %-15s %-11s %-8s %-9s %-9s %-9s %6d\n",
- up->rpf.source_nexthop.interface->name, src_str,
- grp_str, state_str, uptime, join_timer,
+ up->rpf.source_nexthop.interface
+ ? up->rpf.source_nexthop.interface->name
+ : "Unknown",
+ src_str, grp_str, state_str, uptime, join_timer,
rs_timer, ka_timer, up->ref_count);
}
}