diff options
author | Donald Sharp <sharpd@nvidia.com> | 2022-06-08 17:33:32 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2022-06-08 17:36:48 +0200 |
commit | e0220703d1084b97164fe4d8260453f3eb8df38b (patch) | |
tree | ab0693e3f2672d1d0e3f1d560bb5634e4c00658f /pimd/pim_cmd_common.c | |
parent | Merge pull request #11356 from mobash-rasool/pim-rfc-conform (diff) | |
download | frr-e0220703d1084b97164fe4d8260453f3eb8df38b.tar.xz frr-e0220703d1084b97164fe4d8260453f3eb8df38b.zip |
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 <sharpd@nvidia.com>
Diffstat (limited to 'pimd/pim_cmd_common.c')
-rw-r--r-- | pimd/pim_cmd_common.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pimd/pim_cmd_common.c b/pimd/pim_cmd_common.c index d5eb763df..668853e98 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"); |