diff options
| author | Soumya Roy <souroy@nvidia.com> | 2025-03-14 22:01:51 +0000 | 
|---|---|---|
| committer | Soumya Roy <souroy@nvidia.com> | 2025-03-20 16:13:44 +0000 | 
| commit | 860c1e445043c6e380a9fb08cc0c21c6339625ad (patch) | |
| tree | 322b7964416aa14f81b257cbecd830b1e0b052f0 /zebra | |
| parent | 6fe9092eb312e196260ee8deefb73b3f864b1432 (diff) | |
zebra: reduce memory usage by streams when redistributing routes
This commit undo 8c9b007a0c7efb2e9afc2eac936ba9dd971c6707
stream lib has been modified to expand the stream if needed
Now for zapi route encode, we use expandable stream
Signed-off-by: Soumya Roy <souroy@nvidia.com>
Diffstat (limited to 'zebra')
| -rw-r--r-- | zebra/zapi_msg.c | 4 | 
1 files changed, 1 insertions, 3 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 066859d380..9c8ef19a9d 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -518,7 +518,6 @@ int zsend_redistribute_route(int cmd, struct zserv *client, const struct route_n  	const struct prefix *p, *src_p;  	uint16_t count = 0;  	afi_t afi; -	size_t stream_size = 0;  	srcdest_rnode_prefixes(rn, &p, &src_p);  	memset(&api, 0, sizeof(api)); @@ -610,8 +609,7 @@ int zsend_redistribute_route(int cmd, struct zserv *client, const struct route_n  	SET_FLAG(api.message, ZAPI_MESSAGE_MTU);  	api.mtu = re->mtu; -	stream_size = zapi_redistribute_stream_size(&api); -	struct stream *s = stream_new(stream_size); +	struct stream *s = stream_new_expandable(ZEBRA_MAX_PACKET_SIZ);  	/* Encode route and send. */  	if (zapi_route_encode(cmd, s, &api) < 0) {  | 
