diff options
| author | Louis Scalbert <louis.scalbert@6wind.com> | 2024-02-26 18:11:09 +0100 | 
|---|---|---|
| committer | Louis Scalbert <louis.scalbert@6wind.com> | 2024-06-05 13:11:29 +0200 | 
| commit | a6de9104481814508deee38bdcf308f4693a6bca (patch) | |
| tree | be0836c357b007871aba39b83ce260d024afab59 /bgpd/bgp_route.c | |
| parent | ae54c9e455ec7a4fb5289a6c3a28626227e83e68 (diff) | |
bgpd: store number of labels with 8 bits
8 bits are sufficient to store the number of labels because the current
maximum is 2.
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'bgpd/bgp_route.c')
| -rw-r--r-- | bgpd/bgp_route.c | 14 | 
1 files changed, 7 insertions, 7 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 5e4c03ae36..1de3707d7e 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -333,7 +333,7 @@ bool bgp_path_info_has_valid_label(const struct bgp_path_info *path)  bool bgp_path_info_labels_same(const struct bgp_path_info *bpi,  			       const mpls_label_t *label, uint32_t n)  { -	uint32_t bpi_num_labels; +	uint8_t bpi_num_labels;  	const mpls_label_t *bpi_label;  	bpi_num_labels = bgp_path_info_num_labels(bpi); @@ -343,7 +343,7 @@ bool bgp_path_info_labels_same(const struct bgp_path_info *bpi,  			       (const mpls_label_t *)label, n);  } -uint32_t bgp_path_info_num_labels(const struct bgp_path_info *pi) +uint8_t bgp_path_info_num_labels(const struct bgp_path_info *pi)  {  	if (!pi)  		return 0; @@ -1866,7 +1866,7 @@ static bool bgp_check_role_applicability(afi_t afi, safi_t safi)  static int bgp_input_modifier(struct peer *peer, const struct prefix *p,  			      struct attr *attr, afi_t afi, safi_t safi,  			      const char *rmap_name, mpls_label_t *label, -			      uint32_t num_labels, struct bgp_dest *dest) +			      uint8_t num_labels, struct bgp_dest *dest)  {  	struct bgp_filter *filter;  	struct bgp_path_info rmap_path = { 0 }; @@ -4528,7 +4528,7 @@ static bool bgp_accept_own(struct peer *peer, afi_t afi, safi_t safi,  void bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,  		struct attr *attr, afi_t afi, safi_t safi, int type,  		int sub_type, struct prefix_rd *prd, mpls_label_t *label, -		uint32_t num_labels, int soft_reconfig, +		uint8_t num_labels, int soft_reconfig,  		struct bgp_route_evpn *evpn)  {  	int ret; @@ -5441,7 +5441,7 @@ filtered:  void bgp_withdraw(struct peer *peer, const struct prefix *p,  		  uint32_t addpath_id, afi_t afi, safi_t safi, int type,  		  int sub_type, struct prefix_rd *prd, mpls_label_t *label, -		  uint32_t num_labels, struct bgp_route_evpn *evpn) +		  uint8_t num_labels, struct bgp_route_evpn *evpn)  {  	struct bgp *bgp;  	char pfx_buf[BGP_PRD_PATH_STRLEN]; @@ -5668,7 +5668,7 @@ static void bgp_soft_reconfig_table_update(struct peer *peer,  					   safi_t safi, struct prefix_rd *prd)  {  	struct bgp_path_info *pi; -	uint32_t num_labels; +	uint8_t num_labels;  	mpls_label_t *label_pnt;  	struct bgp_route_evpn evpn; @@ -6691,7 +6691,7 @@ void bgp_static_update(struct bgp *bgp, const struct prefix *p,  	int vnc_implicit_withdraw = 0;  	mpls_label_t label = MPLS_INVALID_LABEL;  #endif -	uint32_t num_labels = 0; +	uint8_t num_labels = 0;  	struct bgp *bgp_nexthop = bgp;  	assert(bgp_static);  | 
