diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-08-25 13:46:58 +0300 | 
|---|---|---|
| committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-08-25 14:35:27 +0300 | 
| commit | 511211bf56159caf67280e26cf12d5f3ae31c2b9 (patch) | |
| tree | dc2ae37fcaa12625b01dcfd5fb02fdb59515824c /bgpd/bgp_labelpool.c | |
| parent | 2bf9780b268d29161154e90af3fd6929298eef7e (diff) | |
bgpd: Convert prefix2str to %pFX
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_labelpool.c')
| -rw-r--r-- | bgpd/bgp_labelpool.c | 24 | 
1 files changed, 9 insertions, 15 deletions
diff --git a/bgpd/bgp_labelpool.c b/bgpd/bgp_labelpool.c index 8772afd736..fa1dcf33e0 100644 --- a/bgpd/bgp_labelpool.c +++ b/bgpd/bgp_labelpool.c @@ -719,16 +719,14 @@ DEFUN(show_bgp_labelpool_ledger, show_bgp_labelpool_ledger_cmd,  					vty_out(vty, "%-18s         %u\n",  						"INVALID", lcb->label);  			else { -				char buf[PREFIX2STR_BUFFER];  				p = bgp_dest_get_prefix(dest); -				prefix2str(p, buf, sizeof(buf));  				if (uj) { -					json_object_string_add(json_elem, -							       "prefix", buf); +					json_object_string_addf( +						json_elem, "prefix", "%pFX", p);  					json_object_int_add(json_elem, "label",  							    lcb->label);  				} else -					vty_out(vty, "%-18s    %u\n", buf, +					vty_out(vty, "%-18pFX    %u\n", p,  						lcb->label);  			}  			break; @@ -812,16 +810,14 @@ DEFUN(show_bgp_labelpool_inuse, show_bgp_labelpool_inuse_cmd,  					vty_out(vty, "INVALID         %u\n",  						label);  			else { -				char buf[PREFIX2STR_BUFFER];  				p = bgp_dest_get_prefix(dest); -				prefix2str(p, buf, sizeof(buf));  				if (uj) { -					json_object_string_add(json_elem, -							       "prefix", buf); +					json_object_string_addf( +						json_elem, "prefix", "%pFX", p);  					json_object_int_add(json_elem, "label",  							    label);  				} else -					vty_out(vty, "%-18s    %u\n", buf, +					vty_out(vty, "%-18pFX    %u\n", p,  						label);  			}  			break; @@ -851,7 +847,6 @@ DEFUN(show_bgp_labelpool_requests, show_bgp_labelpool_requests_cmd,  	json_object *json = NULL, *json_elem = NULL;  	struct bgp_dest *dest;  	const struct prefix *p; -	char buf[PREFIX2STR_BUFFER];  	struct lp_fifo *item, *next;  	int count; @@ -893,12 +888,11 @@ DEFUN(show_bgp_labelpool_requests, show_bgp_labelpool_requests_cmd,  					vty_out(vty, "INVALID\n");  			} else {  				p = bgp_dest_get_prefix(dest); -				prefix2str(p, buf, sizeof(buf));  				if (uj) -					json_object_string_add(json_elem, -							       "prefix", buf); +					json_object_string_addf( +						json_elem, "prefix", "%pFX", p);  				else -					vty_out(vty, "%-18s\n", buf); +					vty_out(vty, "%-18pFX\n", p);  			}  			break;  		case LP_TYPE_VRF:  | 
