diff options
| author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2022-01-27 09:51:59 +0200 | 
|---|---|---|
| committer | Donatas Abraitis <donatas.abraitis@gmail.com> | 2022-02-01 13:31:16 +0200 | 
| commit | be92fc9f1aae0f59e3d9f35bf9a557180b8ee7c6 (patch) | |
| tree | 6cce785cde9a740ab1432119c9054e4f88e3288e /bgpd/bgp_label.c | |
| parent | 23ad8186e5bec98d849c56a35f956d390d608e7f (diff) | |
bgpd: Convert bgp_addpath_encode_[tr]x() to bool from int
Rename addpath_encode[d] to addpath_capable to be consistent.
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'bgpd/bgp_label.c')
| -rw-r--r-- | bgpd/bgp_label.c | 9 | 
1 files changed, 3 insertions, 6 deletions
diff --git a/bgpd/bgp_label.c b/bgpd/bgp_label.c index c101cf917b..4a20f2c090 100644 --- a/bgpd/bgp_label.c +++ b/bgpd/bgp_label.c @@ -335,7 +335,7 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr,  	int prefixlen;  	afi_t afi;  	safi_t safi; -	int addpath_encoded; +	bool addpath_capable;  	uint32_t addpath_id;  	mpls_label_t label = MPLS_INVALID_LABEL;  	uint8_t llen; @@ -346,16 +346,13 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr,  	safi = packet->safi;  	addpath_id = 0; -	addpath_encoded = -		(CHECK_FLAG(peer->af_cap[afi][safi], PEER_CAP_ADDPATH_AF_RX_ADV) -		 && CHECK_FLAG(peer->af_cap[afi][safi], -			       PEER_CAP_ADDPATH_AF_TX_RCV)); +	addpath_capable = bgp_addpath_encode_rx(peer, afi, safi);  	for (; pnt < lim; pnt += psize) {  		/* Clear prefix structure. */  		memset(&p, 0, sizeof(struct prefix)); -		if (addpath_encoded) { +		if (addpath_capable) {  			/* When packet overflow occurs return immediately. */  			if (pnt + BGP_ADDPATH_ID_LEN > lim)  | 
