From 4ca997a8f82e442ef3e28a8ae14c0b914adc5e4a Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 28 Feb 2018 18:53:44 -0500 Subject: lib: Use STREAM_GET The addition of some rmac code snuck in the usage of a stream_get instead of a STREAM_GET() We need to be using STREAM_GET() Signed-off-by: Donald Sharp --- lib/zclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/zclient.c') diff --git a/lib/zclient.c b/lib/zclient.c index ad91eb504b..01d8838e1f 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -1085,7 +1085,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api) STREAM_GETC(s, api->message); STREAM_GETC(s, api->safi); if (CHECK_FLAG(api->flags, ZEBRA_FLAG_EVPN_ROUTE)) - stream_get(&(api->rmac), s, sizeof(struct ethaddr)); + STREAM_GET(&(api->rmac), s, sizeof(struct ethaddr)); /* Prefix. */ STREAM_GETC(s, api->prefix.family); -- cgit v1.2.3 From 05dd5aaf021e2e483ba44872cae4446b0073c1de Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 28 Feb 2018 19:22:47 -0500 Subject: lib, zebra: Add type and instance to nexthop update message 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 --- lib/zclient.c | 2 ++ zebra/zebra_rnh.c | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'lib/zclient.c') diff --git a/lib/zclient.c b/lib/zclient.c index ad91eb504b..09c3abc148 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -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); diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c index 9fc5afff0f..d960dbd937 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -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 -- cgit v1.2.3