diff options
| author | Chirag Shah <chirag@cumulusnetworks.com> | 2017-06-22 12:09:02 -0700 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-07-24 13:51:40 -0400 |
| commit | 96ceedc7a27404a148bc9cc513b5b60e286cffc2 (patch) | |
| tree | b17a4bf7ab7c6d183017e4ee45df3335c794c64c /pimd/pim_cmd.c | |
| parent | cc61055f0ed2cb8521dd685b3456b503ef297190 (diff) | |
pimd: display down ports show ip pim interface
In show ip pim interface and show ip pim interface <intf>
display State "down" pim enabled interfaces.
Ticket:CM-16809
Reviewed By:CCR-6398
Testing Done:
show ip pim interface
Interface State Address PIM Nbrs PIM DR FHR IfChannels
br1 up 2.0.1.1 0 local 0 0
lo up 6.0.0.1 0 local 0 0
pimreg up 0.0.0.0 0 local 0 0
swp1 down 6.0.1.1 0 local 0 0
swp2 up 6.0.2.1 1 local 0 0
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_cmd.c')
| -rw-r--r-- | pimd/pim_cmd.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index cdccfef7ac..9c792c2a43 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -629,7 +629,7 @@ static void igmp_show_interfaces_single(struct vty *vty, char other_hhmmss[10]; int found_ifname = 0; int sqi; - int mloop; + int mloop = 0; long gmi_msec; /* Group Membership Interval */ long lmqt_msec; long ohpi_msec; @@ -692,7 +692,11 @@ static void igmp_show_interfaces_single(struct vty *vty, qri_msec = pim_ifp->igmp_query_max_response_time_dsec * 100; - mloop = pim_socket_mcastloop_get(pim_ifp->pim_sock_fd); + if (pim_ifp->pim_sock_fd >= 0) + mloop = pim_socket_mcastloop_get( + pim_ifp->pim_sock_fd); + else + mloop = 0; if (uj) { json_row = json_object_new_object(); @@ -889,7 +893,7 @@ static void pim_show_interfaces_single(struct vty *vty, char src_str[INET_ADDRSTRLEN]; char stat_uptime[10]; char uptime[10]; - int mloop; + int mloop = 0; int found_ifname = 0; int print_header; json_object *json = NULL; @@ -913,9 +917,6 @@ static void pim_show_interfaces_single(struct vty *vty, if (!pim_ifp) continue; - if (pim_ifp->pim_sock_fd < 0) - continue; - if (strcmp(ifname, "detail") && strcmp(ifname, ifp->name)) continue; @@ -931,7 +932,10 @@ static void pim_show_interfaces_single(struct vty *vty, pim_ifp->pim_hello_period); pim_time_uptime(stat_uptime, sizeof(stat_uptime), now - pim_ifp->pim_ifstat_start); - mloop = pim_socket_mcastloop_get(pim_ifp->pim_sock_fd); + if (pim_ifp->pim_sock_fd >= 0) + mloop = pim_socket_mcastloop_get(pim_ifp->pim_sock_fd); + else + mloop = 0; if (uj) { char pbuf[PREFIX2STR_BUFFER]; @@ -1308,9 +1312,6 @@ static void pim_show_interfaces(struct vty *vty, struct pim_instance *pim, if (!pim_ifp) continue; - if (pim_ifp->pim_sock_fd < 0) - continue; - pim_nbrs = pim_ifp->pim_neighbor_list->count; pim_ifchannels = pim_ifp->pim_ifchannel_list->count; fhr = 0; |
