diff options
| author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-03-20 11:57:54 +0200 | 
|---|---|---|
| committer | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-03-21 14:59:18 +0200 | 
| commit | 3dc339cdc2686a1fe6008acd827f9f5ba11a9fed (patch) | |
| tree | e405af3f4d5ea456eeb19ef6f3dc629060b66a0e /bgpd/bgp_attr_evpn.c | |
| parent | 09fdbbe98cf143a5cf0418d6f804646ee00a9e4d (diff) | |
bgpd: Convert lots of int type functions to bool/void
Some were converted to bool, where true/false status is needed.
Converted to void only those, where the return status was only false or true.
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'bgpd/bgp_attr_evpn.c')
| -rw-r--r-- | bgpd/bgp_attr_evpn.c | 10 | 
1 files changed, 5 insertions, 5 deletions
diff --git a/bgpd/bgp_attr_evpn.c b/bgpd/bgp_attr_evpn.c index ec9656a98d..6941e1f9b5 100644 --- a/bgpd/bgp_attr_evpn.c +++ b/bgpd/bgp_attr_evpn.c @@ -54,25 +54,25 @@ void bgp_add_routermac_ecom(struct attr *attr, struct ethaddr *routermac)   * format accepted: AA:BB:CC:DD:EE:FF:GG:HH:II:JJ   * if id is null, check only is done   */ -int str2esi(const char *str, struct eth_segment_id *id) +bool str2esi(const char *str, struct eth_segment_id *id)  {  	unsigned int a[ESI_LEN];  	int i;  	if (!str) -		return 0; +		return false;  	if (sscanf(str, "%2x:%2x:%2x:%2x:%2x:%2x:%2x:%2x:%2x:%2x", a + 0, a + 1,  		   a + 2, a + 3, a + 4, a + 5, a + 6, a + 7, a + 8, a + 9)  	    != ESI_LEN) {  		/* error in incoming str length */ -		return 0; +		return false;  	}  	/* valid mac address */  	if (!id) -		return 1; +		return true;  	for (i = 0; i < ESI_LEN; ++i)  		id->val[i] = a[i] & 0xff; -	return 1; +	return true;  }  char *esi2str(struct eth_segment_id *id)  | 
