From: Stephen Worley Date: Thu, 11 Jun 2020 17:45:03 +0000 (-0400) Subject: lib,zebra: fixup NHG notify zapi messaging X-Git-Tag: base_7.6~489^2~20 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=2c7819b9d42ab4c1af56946819b6721f27011e9a;p=mirror%2Ffrr.git lib,zebra: fixup NHG notify zapi messaging Make the message parameters align better with other zapi notifications and change the ID to correctly be a uint32. Signed-off-by: Stephen Worley --- diff --git a/lib/zclient.c b/lib/zclient.c index cde2f5e052..2e65e3c9f7 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -1486,10 +1486,10 @@ int zapi_pbr_rule_encode(uint8_t cmd, struct stream *s, struct pbr_rule *zrule) bool zapi_nhg_notify_decode(struct stream *s, uint32_t *id, enum zapi_nhg_notify_owner *note) { - uint16_t read_id; + uint32_t read_id; - STREAM_GETL(s, read_id); STREAM_GET(note, s, sizeof(*note)); + STREAM_GETL(s, read_id); *id = read_id; diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index c8220af81e..21f40ce7c2 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -712,7 +712,7 @@ static int zsend_ipv4_nexthop_lookup_mrib(struct zserv *client, return zserv_send_message(client, s); } -static int nhg_notify(uint16_t type, uint16_t instance, uint16_t id, +static int nhg_notify(uint16_t type, uint16_t instance, uint32_t id, enum zapi_nhg_notify_owner note) { struct zserv *client; @@ -732,8 +732,8 @@ static int nhg_notify(uint16_t type, uint16_t instance, uint16_t id, zclient_create_header(s, ZEBRA_NHG_NOTIFY_OWNER, VRF_DEFAULT); - stream_putw(s, id); stream_put(s, ¬e, sizeof(note)); + stream_putl(s, id); stream_putw_at(s, 0, stream_get_endp(s));