]> git.proxmox.com Git - mirror_frr.git/commitdiff
pimd: pim_addr_cmp returns 0 for same not -1 or 1
authorDonald Sharp <sharpd@nvidia.com>
Wed, 8 Jun 2022 15:33:32 +0000 (11:33 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 8 Jun 2022 15:36:48 +0000 (11:36 -0400)
The test for setting pimDesignatedRouterLocal was comparing
the result of pim_addr_cmp to non zero to say that the
pim_dr_addr and primary_address are the same.  This is
not correct in that pim_addr_cmp returns 0 for being the
same, so the correct test is !pim_addr_cmp

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
pimd/pim_cmd_common.c

index d5eb763df350be0fd0fd2df0817d3097adf01eb7..668853e988bd700639b3613dc1012c746253f813 100644 (file)
@@ -1989,8 +1989,8 @@ void pim_show_interfaces(struct pim_instance *pim, struct vty *vty, bool mlag,
                json_object_string_addf(json_row, "pimDesignatedRouter",
                                        "%pPAs", &pim_ifp->pim_dr_addr);
 
-               if (pim_addr_cmp(pim_ifp->pim_dr_addr,
-                                pim_ifp->primary_address))
+               if (!pim_addr_cmp(pim_ifp->pim_dr_addr,
+                                 pim_ifp->primary_address))
                        json_object_boolean_true_add(
                                json_row, "pimDesignatedRouterLocal");