]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib,zebra: fixup NHG notify zapi messaging
authorStephen Worley <sworley@cumulusnetworks.com>
Thu, 11 Jun 2020 17:45:03 +0000 (13:45 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Mon, 28 Sep 2020 16:41:00 +0000 (12:41 -0400)
Make the message parameters align better with other zapi
notifications and change the ID to correctly be a uint32.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
lib/zclient.c
zebra/zapi_msg.c

index cde2f5e05243a6c02062e52dcd0d718d4a111491..2e65e3c9f78e992ae422ba4435164ded458362b8 100644 (file)
@@ -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;
 
index c8220af81ecfbe25b8f5ebf0a055cd815d58ab76..21f40ce7c2a3df245e6a09edb4f9f883aa263dca 100644 (file)
@@ -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, &note, sizeof(note));
+       stream_putl(s, id);
 
        stream_putw_at(s, 0, stream_get_endp(s));