From: Donald Sharp Date: Wed, 8 Jun 2022 15:33:32 +0000 (-0400) Subject: pimd: pim_addr_cmp returns 0 for same not -1 or 1 X-Git-Tag: base_8.4~382^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=e0220703d1084b97164fe4d8260453f3eb8df38b;p=mirror%2Ffrr.git pimd: pim_addr_cmp returns 0 for same not -1 or 1 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 --- diff --git a/pimd/pim_cmd_common.c b/pimd/pim_cmd_common.c index d5eb763df3..668853e988 100644 --- a/pimd/pim_cmd_common.c +++ b/pimd/pim_cmd_common.c @@ -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");