diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-12-18 08:09:29 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-01-04 12:21:00 -0500 |
| commit | 02c0866dbee8b1ecfec3bcf7167f35e24eceede9 (patch) | |
| tree | 0a061ff96b5ca1ea26984b8a864fa3fe6fe56334 | |
| parent | ff1fb8d5f6171ed66f00339152f3e8433a7ff65d (diff) | |
lib, zebra: On startup send mlag role as part of the capabilities
On startup send the mlag role as part of the capabilities to
the end protocol.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| -rw-r--r-- | lib/zclient.c | 1 | ||||
| -rw-r--r-- | lib/zclient.h | 3 | ||||
| -rw-r--r-- | zebra/zapi_msg.c | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/lib/zclient.c b/lib/zclient.c index d2a6c75548..1c40750db0 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -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); diff --git a/lib/zclient.h b/lib/zclient.h index 8fe711f310..831cccfb7e 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -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. */ diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 32614f408e..faa0eb90e4 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -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); |
