]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib, zebra: On startup send mlag role as part of the capabilities
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 18 Dec 2018 13:09:29 +0000 (08:09 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 4 Jan 2019 17:21:00 +0000 (12:21 -0500)
On startup send the mlag role as part of the capabilities to
the end protocol.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/zclient.c
lib/zclient.h
zebra/zapi_msg.c

index d2a6c75548f41698834c1ec3efacc1f6eff85e9a..1c40750db07e1bf56f96ccceb36ddcd0a98433b2 100644 (file)
@@ -2355,6 +2355,7 @@ static void zclient_capability_decode(int command, struct zclient *zclient,
        STREAM_GETC(s, mpls_enabled);
        cap.mpls_enabled = !!mpls_enabled;
        STREAM_GETL(s, cap.ecmp);
+       STREAM_GETC(s, cap.role);
 
        if (zclient->zebra_capabilities)
                (*zclient->zebra_capabilities)(&cap);
index 8fe711f31044f24fe8126b247c143056031709c5..831cccfb7e17b9b8394c54e28fdf379a2820578c 100644 (file)
@@ -36,6 +36,8 @@
 /* For union pw_protocol_fields */
 #include "pw.h"
 
+#include "mlag.h"
+
 /* For input/output buffer to zebra. */
 #define ZEBRA_MAX_PACKET_SIZ          16384
 
@@ -171,6 +173,7 @@ struct redist_proto {
 struct zclient_capabilities {
        uint32_t ecmp;
        bool mpls_enabled;
+       enum mlag_role role;
 };
 
 /* Structure for the zebra client. */
index 32614f408e6085384db76d641f2ac550b33b8686..faa0eb90e4c300bf0a024c2e5e902aa5c979bac8 100644 (file)
@@ -63,6 +63,7 @@
 #include "zebra/table_manager.h"
 #include "zebra/zapi_msg.h"
 #include "zebra/zebra_errors.h"
+#include "zebra/zebra_mlag.h"
 
 /* Encoding helpers -------------------------------------------------------- */
 
@@ -1657,6 +1658,7 @@ static void zsend_capabilities(struct zserv *client, struct zebra_vrf *zvrf)
        zclient_create_header(s, ZEBRA_CAPABILITIES, zvrf->vrf->vrf_id);
        stream_putc(s, mpls_enabled);
        stream_putl(s, multipath_num);
+       stream_putc(s, zebra_mlag_get_role());
 
        stream_putw_at(s, 0, stream_get_endp(s));
        zserv_send_message(client, s);