[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251018015722.1df7f4a6@phoenix.lan>
Date: Sat, 18 Oct 2025 01:57:22 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Hangbin Liu <liuhangbin@...il.com>
Cc: netdev@...r.kernel.org, Jay Vosburgh <jv@...sburgh.net>, Andrew Lunn
<andrew+netdev@...n.ch>, "David S. Miller" <davem@...emloft.net>, Eric
Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo
Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>, David Ahern
<dsahern@...il.com>, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH iproute2-next] bond: slave: print master name
On Fri, 17 Oct 2025 03:05:09 +0000
Hangbin Liu <liuhangbin@...il.com> 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
Powered by blists - more mailing lists