Subject: Re: [PATCH iproute2-next] bond: slave: print master name

From: Stephen Hemminger <[email-masked]>
Date: Sat, 18 Oct 2025 01:57:22 -0700

On Fri, 17 Oct 2025 03:05:09 +0000
Hangbin Liu <[email-masked]> wrote:

> diff --git a/ip/iplink_bond_slave.c b/ip/iplink_bond_slave.c
> index c88100e248dd..55deaadf5fe2 100644
> --- a/ip/iplink_bond_slave.c
> +++ b/ip/iplink_bond_slave.c
> @@ -92,6 +92,17 @@ static void bond_slave_print_opt(struct link_util *lu, FILE *f, struct rtattr *t
>  	if (!tb)
>  		return;
>  
> +	if (tb[IFLA_BOND_SLAVE_MASTER]) {
> +		unsigned int ifindex = rta_getattr_u32(tb[IFLA_BOND_SLAVE_MASTER]);
> +
> +		if (ifindex) {
> +			print_string(PRINT_ANY,
> +				     "master",
> +				     "master %s ",
> +				     ll_index_to_name(ifindex));
> +		}
> +	}

You should use print_color_string(PRINT_ANY, COLOR_IFNAME, ...) here