]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Set "has" flags on optional scalar fields of FPM protobuf messages 1985/head
authorSergey Fionov <fionov@gmail.com>
Wed, 28 Mar 2018 22:51:31 +0000 (01:51 +0300)
committerSergey Fionov <fionov@gmail.com>
Thu, 29 Mar 2018 16:09:43 +0000 (19:09 +0300)
Otherwise, these fields are not serialized.

Signed-off-by: Sergey Fionov <fionov@gmail.com>
zebra/zebra_fpm_protobuf.c

index e661b6efc77748065d9b17c1b73b2e364475c813..ebd632270c7d004b855799e55fcd3c2776a3dcd7 100644 (file)
@@ -163,6 +163,7 @@ static Fpm__AddRoute *create_add_route_message(qpb_allocator_t *allocator,
        msg->sub_address_family = QPB__SUB_ADDRESS_FAMILY__UNICAST;
        msg->key = fpm_route_key_create(allocator, rib_dest_prefix(dest));
        qpb_protocol_set(&msg->protocol, re->type);
+       msg->has_route_type = 1;
        msg->route_type = FPM__ROUTE_TYPE__NORMAL;
        msg->metric = re->metric;
 
@@ -245,6 +246,7 @@ static Fpm__Message *create_route_message(qpb_allocator_t *allocator,
        fpm__message__init(msg);
 
        if (!re) {
+               msg->has_type = 1;
                msg->type = FPM__MESSAGE__TYPE__DELETE_ROUTE;
                msg->delete_route =
                        create_delete_route_message(allocator, dest, re);
@@ -255,6 +257,7 @@ static Fpm__Message *create_route_message(qpb_allocator_t *allocator,
                return msg;
        }
 
+       msg->has_type = 1;
        msg->type = FPM__MESSAGE__TYPE__ADD_ROUTE;
        msg->add_route = create_add_route_message(allocator, dest, re);
        if (!msg->add_route) {