summaryrefslogtreecommitdiff
path: root/zebra/zebra_mlag.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-01-14 11:08:19 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-01-31 09:28:39 -0500
commitb120fe3b69208980372d04728ee57894b6a7a842 (patch)
treed8af3a2920450b0233ea6dce17bc9e12b0d81004 /zebra/zebra_mlag.c
parent414d885aacb6cedb9ffee496739ee32e6235d3cb (diff)
zebra: Add ability to send to all clients updated capability information
When capability information changes, allow for resending of data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_mlag.c')
-rw-r--r--zebra/zebra_mlag.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/zebra/zebra_mlag.c b/zebra/zebra_mlag.c
index a510f2f8d9..5012cc2a49 100644
--- a/zebra/zebra_mlag.c
+++ b/zebra/zebra_mlag.c
@@ -26,6 +26,8 @@
#include "zebra/zebra_mlag.h"
#include "zebra/zebra_router.h"
+#include "zebra/zapi_msg.h"
+#include "zebra/debug.h"
#ifndef VTYSH_EXTRACT_PL
#include "zebra/zebra_mlag_clippy.c"
@@ -61,6 +63,9 @@ DEFPY_HIDDEN (test_mlag,
"Mlag is setup to be primary\n"
"Mlag is setup to be the secondary\n")
{
+ enum mlag_role orig = zrouter.mlag_info.role;
+ char buf1[80], buf2[80];
+
if (none)
zrouter.mlag_info.role = MLAG_ROLE_NONE;
if (primary)
@@ -68,6 +73,14 @@ DEFPY_HIDDEN (test_mlag,
if (secondary)
zrouter.mlag_info.role = MLAG_ROLE_SECONDARY;
+ if (IS_ZEBRA_DEBUG_MLAG)
+ zlog_debug("Test: Changing role from %s to %s",
+ mlag_role2str(orig, buf1, sizeof(buf1)),
+ mlag_role2str(orig, buf2, sizeof(buf2)));
+
+ if (orig != zrouter.mlag_info.role)
+ zsend_capabilities_all_clients();
+
return CMD_SUCCESS;
}