diff --git a/lib/zclient.h b/lib/zclient.h index 290e7bac22ce..5383679f3e39 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -45,7 +45,7 @@ typedef uint16_t zebra_size_t; /* For input/output buffer to zebra. */ #define ZEBRA_MAX_PACKET_SIZ 16384U -#define ZEBRA_SMALL_PACKET_SIZE 200U +#define ZEBRA_SMALL_PACKET_SIZE 200U /* Zebra header size. */ #define ZEBRA_HEADER_SIZE 10 diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 4092355b31ef..0a3c74740210 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -286,7 +286,7 @@ int zsend_interface_address(int cmd, struct zserv *client, { int blen; struct prefix *p; - struct stream *s = stream_new(ZEBRA_MAX_PACKET_SIZ); + struct stream *s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, cmd, ifp->vrf->vrf_id); stream_putl(s, ifp->ifindex); @@ -327,7 +327,7 @@ static int zsend_interface_nbr_address(int cmd, struct zserv *client, struct nbr_connected *ifc) { int blen; - struct stream *s = stream_new(ZEBRA_MAX_PACKET_SIZ); + struct stream *s = stream_new(ZEBRA_SMALL_PACKET_SIZE); struct prefix *p; zclient_create_header(s, cmd, ifp->vrf->vrf_id); @@ -655,7 +655,7 @@ static int zsend_nexthop_lookup_mrib(struct zserv *client, struct ipaddr *addr, struct nexthop *nexthop; /* Get output stream. */ - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); stream_reset(s); /* Fill in result. */ @@ -710,7 +710,7 @@ int zsend_nhg_notify(uint16_t type, uint16_t instance, uint32_t session_id, zlog_debug("%s: type %d, id %d, note %s", __func__, type, id, zapi_nhg_notify_owner2str(note)); - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); stream_reset(s); zclient_create_header(s, ZEBRA_NHG_NOTIFY_OWNER, VRF_DEFAULT); @@ -843,7 +843,7 @@ void zsend_rule_notify_owner(const struct zebra_dplane_ctx *ctx, if (!client) return; - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, ZEBRA_RULE_NOTIFY_OWNER, dplane_ctx_rule_get_vrfid(ctx)); @@ -897,7 +897,7 @@ void zsend_iptable_notify_owner(const struct zebra_dplane_ctx *ctx, if (!client) return; - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, cmd, VRF_DEFAULT); stream_putw(s, note); @@ -931,7 +931,7 @@ void zsend_ipset_notify_owner(const struct zebra_dplane_ctx *ctx, if (!client) return; - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, cmd, VRF_DEFAULT); stream_putw(s, note); @@ -967,7 +967,7 @@ void zsend_ipset_entry_notify_owner(const struct zebra_dplane_ctx *ctx, if (!client) return; - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, cmd, VRF_DEFAULT); stream_putw(s, note); @@ -1015,13 +1015,12 @@ int zsend_router_id_update(struct zserv *client, afi_t afi, struct prefix *p, vrf_id_t vrf_id) { int blen; - struct stream *s; /* Check this client need interface information. */ if (!vrf_bitmap_check(&client->ridinfo[afi], vrf_id)) return 0; - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + struct stream *s = stream_new(ZEBRA_SMALL_PACKET_SIZE); /* Message type. */ zclient_create_header(s, ZEBRA_ROUTER_ID_UPDATE, vrf_id); @@ -1043,7 +1042,7 @@ int zsend_router_id_update(struct zserv *client, afi_t afi, struct prefix *p, */ int zsend_pw_update(struct zserv *client, struct zebra_pw *pw) { - struct stream *s = stream_new(ZEBRA_MAX_PACKET_SIZ); + struct stream *s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, ZEBRA_PW_STATUS_UPDATE, pw->vrf_id); stream_write(s, pw->ifname, IFNAMSIZ); @@ -1060,7 +1059,7 @@ int zsend_pw_update(struct zserv *client, struct zebra_pw *pw) int zsend_assign_label_chunk_response(struct zserv *client, vrf_id_t vrf_id, struct label_manager_chunk *lmc) { - struct stream *s = stream_new(ZEBRA_MAX_PACKET_SIZ); + struct stream *s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, ZEBRA_GET_LABEL_CHUNK, vrf_id); /* proto */ @@ -1086,7 +1085,7 @@ int zsend_assign_label_chunk_response(struct zserv *client, vrf_id_t vrf_id, int zsend_label_manager_connect_response(struct zserv *client, vrf_id_t vrf_id, unsigned short result) { - struct stream *s = stream_new(ZEBRA_MAX_PACKET_SIZ); + struct stream *s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, ZEBRA_LABEL_MANAGER_CONNECT, vrf_id); @@ -1110,7 +1109,7 @@ static int zsend_assign_table_chunk_response(struct zserv *client, vrf_id_t vrf_id, struct table_manager_chunk *tmc) { - struct stream *s = stream_new(ZEBRA_MAX_PACKET_SIZ); + struct stream *s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, ZEBRA_GET_TABLE_CHUNK, vrf_id); @@ -1130,7 +1129,7 @@ static int zsend_table_manager_connect_response(struct zserv *client, vrf_id_t vrf_id, uint16_t result) { - struct stream *s = stream_new(ZEBRA_MAX_PACKET_SIZ); + struct stream *s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, ZEBRA_TABLE_MANAGER_CONNECT, vrf_id); @@ -2359,7 +2358,7 @@ static void zread_router_id_delete(ZAPI_HANDLER_ARGS) static void zsend_capabilities(struct zserv *client, struct zebra_vrf *zvrf) { - struct stream *s = stream_new(ZEBRA_MAX_PACKET_SIZ); + struct stream *s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, ZEBRA_CAPABILITIES, zvrf->vrf->vrf_id); stream_putl(s, vrf_get_backend()); @@ -3866,8 +3865,7 @@ static inline void zebra_gre_source_set(ZAPI_HANDLER_ARGS) static void zsend_error_msg(struct zserv *client, enum zebra_error_types error, struct zmsghdr *bad_hdr) { - - struct stream *s = stream_new(ZEBRA_MAX_PACKET_SIZ); + struct stream *s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, ZEBRA_ERROR, bad_hdr->vrf_id); diff --git a/zebra/zebra_csm.c b/zebra/zebra_csm.c index ad94794b9221..383e945f33b8 100644 --- a/zebra/zebra_csm.c +++ b/zebra/zebra_csm.c @@ -243,7 +243,7 @@ static void zebra_csm_maint_mode(struct event *t) client = zserv_find_client(ZEBRA_ROUTE_BGP, 0); if (client) { - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, ZEBRA_MAINTENANCE_MODE, VRF_DEFAULT); stream_putc(s, enter); /* Write packet size. */ @@ -275,7 +275,7 @@ static void zebra_csm_fast_restart(struct event *t) zrouter.fast_shutdown = true; client = zserv_find_client(ZEBRA_ROUTE_BGP, 0); if (client) { - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, ZEBRA_FAST_SHUTDOWN, VRF_DEFAULT); stream_putc(s, upgrade); /* Write packet size. */ diff --git a/zebra/zebra_evpn.c b/zebra/zebra_evpn.c index 147f5b93faae..cada972be9fe 100644 --- a/zebra/zebra_evpn.c +++ b/zebra/zebra_evpn.c @@ -383,7 +383,7 @@ static int ip_prefix_send_to_client(vrf_id_t vrf_id, struct prefix *p, if (!client) return 0; - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, cmd, vrf_id); stream_put(s, p, sizeof(struct prefix)); @@ -1182,7 +1182,7 @@ int zebra_evpn_send_add_to_client(struct zebra_evpn *zevpn) svi_index = zevpn->svi_if ? zevpn->svi_if->ifindex : 0; - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, ZEBRA_VNI_ADD, zebra_vrf_get_evpn_id()); stream_putl(s, zevpn->vni); @@ -1234,7 +1234,7 @@ int zebra_evpn_send_del_to_client(struct zebra_evpn *zevpn) zebra_evpn_update_all_es(zevpn); } - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); stream_reset(s); zclient_create_header(s, ZEBRA_VNI_DEL, zebra_vrf_get_evpn_id()); diff --git a/zebra/zebra_evpn_mac.c b/zebra/zebra_evpn_mac.c index 9ecd85bbf29c..975a642c6de7 100644 --- a/zebra/zebra_evpn_mac.c +++ b/zebra/zebra_evpn_mac.c @@ -1004,7 +1004,7 @@ int zebra_evpn_macip_send_msg_to_client(vni_t vni, if (!client) return 0; - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, cmd, zebra_vrf_get_evpn_id()); stream_putl(s, vni); diff --git a/zebra/zebra_evpn_mh.c b/zebra/zebra_evpn_mh.c index e962e18a43d1..a012f18094b0 100644 --- a/zebra/zebra_evpn_mh.c +++ b/zebra/zebra_evpn_mh.c @@ -2256,7 +2256,7 @@ static int zebra_evpn_es_send_add_to_client(struct zebra_evpn_es *es) if (!client) return 0; - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, ZEBRA_LOCAL_ES_ADD, zebra_vrf_get_evpn_id()); stream_put(s, &es->esi, sizeof(esi_t)); @@ -2292,7 +2292,7 @@ static int zebra_evpn_es_send_del_to_client(struct zebra_evpn_es *es) if (!client) return 0; - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); stream_reset(s); zclient_create_header(s, ZEBRA_LOCAL_ES_DEL, zebra_vrf_get_evpn_id()); @@ -2975,7 +2975,7 @@ static int zebra_evpn_es_evi_send_to_client(struct zebra_evpn_es *es, if (!client) return 0; - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, add ? ZEBRA_LOCAL_ES_EVI_ADD : ZEBRA_LOCAL_ES_EVI_DEL, diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index 39fc678c23c3..294bc4b8c2ff 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -436,7 +436,7 @@ static int fec_send(struct zebra_fec *fec, struct zserv *client) rn = fec->rn; /* Get output stream. */ - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, ZEBRA_FEC_UPDATE, VRF_DEFAULT); diff --git a/zebra/zebra_mroute.c b/zebra/zebra_mroute.c index 881b681c2f6d..86e25469ba2d 100644 --- a/zebra/zebra_mroute.c +++ b/zebra/zebra_mroute.c @@ -61,7 +61,7 @@ void zebra_ipmr_route_stats(ZAPI_HANDLER_ARGS) suc = kernel_get_ipmr_sg_stats(zvrf, &mroute); stream_failure: - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); stream_reset(s); diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index a33fada64a71..1cd5e3fc20d2 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -2248,7 +2248,7 @@ static int zl3vni_send_add_to_client(struct zebra_l3vni *zl3vni) is_anycast_mac = false; } - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); /* The message is used for both vni add and/or update like * vrr mac is added for l3vni SVI. @@ -2291,7 +2291,7 @@ static int zl3vni_send_del_to_client(struct zebra_l3vni *zl3vni) if (!client) return 0; - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, ZEBRA_L3VNI_DEL, zl3vni_vrf_id(zl3vni)); stream_putl(s, zl3vni->vni); @@ -5915,7 +5915,7 @@ static int zebra_vxlan_sg_send(struct zebra_vrf *zvrf, if (!CHECK_FLAG(zvrf->flags, ZEBRA_PIM_SEND_VXLAN_SG)) return 0; - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); zclient_create_header(s, cmd, VRF_DEFAULT); stream_putl(s, IPV4_MAX_BYTELEN);