]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Show interface traffic even if interface is currently `down` 11379/head
authorDonald Sharp <sharpd@nvidia.com>
Thu, 9 Jun 2022 14:29:04 +0000 (10:29 -0400)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Thu, 9 Jun 2022 17:01:14 +0000 (17:01 +0000)
the `show ip pim interface [x] traffic` command was deciding
to skip display of interfaces if they happened to be down at
that moment.  This of course does not make a bunch of sense
to limit the output for a interface that may have sent data
in the past.

This fixes this test crash:
rnode = <lib.topogen.TopoRouter object at 0x7fc755be3880>, dut = 'c1', input_dict = {'c1': {'c1-l1-eth2': ['helloTx', 'helloRx']}}, output_dict = {'c1': {}}

    def show_pim_intf_traffic(rnode, dut, input_dict, output_dict):
        show_pim_intf_traffic_json = run_frr_cmd(
            rnode, "show ip pim interface traffic json", isjson=True
        )

        output_dict[dut] = {}
        for intf, data in input_dict[dut].items():
>           interface_json = show_pim_intf_traffic_json[intf]
E           KeyError: 'c1-l1-eth2'

/home/sharpd/frr8/tests/topotests/lib/pim.py:1496: KeyError

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit a64543e3e8f0210e12bf9749e4302dc216f93b61)

pimd/pim_cmd.c

index a481970632e58c8649ac776d002830bd50780ea2..ec1c26209b48d9c1b627fed2ad929264cbb6bbb7 100644 (file)
@@ -1516,8 +1516,6 @@ static void pim_show_interface_traffic(struct pim_instance *pim,
                if (!pim_ifp)
                        continue;
 
-               if (pim_ifp->pim_sock_fd < 0)
-                       continue;
                if (uj) {
                        json_row = json_object_new_object();
                        json_object_pim_ifp_add(json_row, ifp);
@@ -1610,9 +1608,6 @@ static void pim_show_interface_traffic_single(struct pim_instance *pim,
                if (!pim_ifp)
                        continue;
 
-               if (pim_ifp->pim_sock_fd < 0)
-                       continue;
-
                found_ifname = 1;
                if (uj) {
                        json_row = json_object_new_object();