]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: pim mlag summary should display the down connection status. 15661/head
authorRajesh Varatharaj <rvaratharaj@nvidia.com>
Tue, 2 Apr 2024 22:12:10 +0000 (15:12 -0700)
committerRajesh Varatharaj <rvaratharaj@nvidia.com>
Fri, 5 Apr 2024 17:52:05 +0000 (10:52 -0700)
command 'show ip pim mlag summary json' should display 'mlagConnUp',
'mlagPeerConnUp', and 'mlagPeerZebraUp' when the connection is down.

Fix:
Added 'json_object_boolean_false_add()' for these objects.

Ticket: #

Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
pimd/pim_cmd.c

index be36a07687e8091611c013b136549b9ca2a4d689..15d3904c37075bd80a03648f1cb96a48a7f32aa1 100644 (file)
@@ -1941,12 +1941,15 @@ DEFUN (show_ip_pim_mlag_summary,
                json_object *json_stat = NULL;
 
                json = json_object_new_object();
-               if (router->mlag_flags & PIM_MLAGF_LOCAL_CONN_UP)
-                       json_object_boolean_true_add(json, "mlagConnUp");
-               if (router->mlag_flags & PIM_MLAGF_PEER_CONN_UP)
-                       json_object_boolean_true_add(json, "mlagPeerConnUp");
-               if (router->mlag_flags & PIM_MLAGF_PEER_ZEBRA_UP)
-                       json_object_boolean_true_add(json, "mlagPeerZebraUp");
+               json_object_boolean_add(json, "mlagConnUp",
+                                       CHECK_FLAG(router->mlag_flags,
+                                                  PIM_MLAGF_LOCAL_CONN_UP));
+               json_object_boolean_add(json, "mlagPeerConnUp",
+                                       CHECK_FLAG(router->mlag_flags,
+                                                  PIM_MLAGF_PEER_CONN_UP));
+               json_object_boolean_add(json, "mlagPeerZebraUp",
+                                       CHECK_FLAG(router->mlag_flags,
+                                                  PIM_MLAGF_PEER_ZEBRA_UP));
                json_object_string_add(json, "mlagRole",
                                       mlag_role2str(router->mlag_role,
                                                     role_buf, sizeof(role_buf)));