summaryrefslogtreecommitdiff
path: root/zebra/zapi_msg.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-02-15 11:39:12 -0500
committerStephen Worley <sworley@cumulusnetworks.com>2019-10-25 11:13:36 -0400
commit9a0d4dd39be7cbed048e45b5a27ceb81608d76f6 (patch)
tree6f99e0b22fb96b36e6c84876cd863336410b0d0b /zebra/zapi_msg.c
parenteecacedc3b9526b59ef690bce41f41158a137c9f (diff)
zebra: Remove nexthop_active_num from route entry
The nexthop_active_num data structure is a property of the nexthop group. Move the keeping of this data to that. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zapi_msg.c')
-rw-r--r--zebra/zapi_msg.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index d207ee4046..ecbf39dda0 100644
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -522,7 +522,7 @@ int zsend_redistribute_route(int cmd, struct zserv *client,
struct zapi_route api;
struct zapi_nexthop *api_nh;
struct nexthop *nexthop;
- int count = 0;
+ uint8_t count = 0;
afi_t afi;
size_t stream_size =
MAX(ZEBRA_MAX_PACKET_SIZ, sizeof(struct zapi_route));
@@ -559,11 +559,6 @@ int zsend_redistribute_route(int cmd, struct zserv *client,
memcpy(&api.src_prefix, src_p, sizeof(api.src_prefix));
}
- /* Nexthops. */
- if (re->nexthop_active_num) {
- SET_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP);
- api.nexthop_num = re->nexthop_active_num;
- }
for (nexthop = re->ng->nexthop; nexthop; nexthop = nexthop->next) {
if (!CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE))
continue;
@@ -595,6 +590,12 @@ int zsend_redistribute_route(int cmd, struct zserv *client,
count++;
}
+ /* Nexthops. */
+ if (count) {
+ SET_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP);
+ api.nexthop_num = count;
+ }
+
/* Attributes. */
SET_FLAG(api.message, ZAPI_MESSAGE_DISTANCE);
api.distance = re->distance;