]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib, zebra: Add type and instance to nexthop update message 1811/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 1 Mar 2018 00:22:47 +0000 (19:22 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 1 Mar 2018 00:22:47 +0000 (19:22 -0500)
Add the originating routes type and instance to the nexthop
update message.  This is necessary because there exist
scenarios where BGP needs to make a decision about the
originating route type and instance to know if it is
going to be doing a route replace to a route that would
resolve to itself.

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

index ad91eb504bafe483fef1d3e52781ddff637ff813..09c3abc148628da21a40ae1cb4f26fb80c1ac8a7 100644 (file)
@@ -1266,6 +1266,8 @@ bool zapi_nexthop_update_decode(struct stream *s, struct zapi_route *nhr)
                break;
        }
 
+       STREAM_GETC(s, nhr->type);
+       STREAM_GETW(s, nhr->instance);
        STREAM_GETC(s, nhr->distance);
        STREAM_GETL(s, nhr->metric);
        STREAM_GETC(s, nhr->nexthop_num);
index 9fc5afff0f392e01bf16638ad16247f4f7f56048..d960dbd93773a5946b64466d591bdd2ef88d834c 100644 (file)
@@ -1019,6 +1019,8 @@ static int send_client(struct rnh *rnh, struct zserv *client, rnh_type_t type,
                break;
        }
        if (re) {
+               stream_putc(s, re->type);
+               stream_putw(s, re->instance);
                stream_putc(s, re->distance);
                stream_putl(s, re->metric);
                num = 0;
@@ -1054,6 +1056,8 @@ static int send_client(struct rnh *rnh, struct zserv *client, rnh_type_t type,
                        }
                stream_putc_at(s, nump, num);
        } else {
+               stream_putc(s, 0); // type
+               stream_putw(s, 0); // instance
                stream_putc(s, 0); // distance
                stream_putl(s, 0); // metric
                stream_putc(s, 0); // nexthops