]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: pim_addr_cmp returns 0 for same not -1 or 1 11373/head
authorDonald Sharp <sharpd@nvidia.com>
Wed, 8 Jun 2022 15:33:32 +0000 (11:33 -0400)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Thu, 9 Jun 2022 06:58:31 +0000 (06:58 +0000)
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>
(cherry picked from commit e0220703d1084b97164fe4d8260453f3eb8df38b)

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");