netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: David Wilder <wilder@us.ibm.com>
Cc: netdev@vger.kernel.org, jv@jvosburgh.net,
	pradeeps@linux.vnet.ibm.com, pradeep@us.ibm.com,
	i.maximets@ovn.org, amorenoz@redhat.com, haliu@redhat.com,
	dsahern@gmail.com
Subject: Re: [PATCH iproute2-next v5 1/1] iproute: Extend bonding's "arp_ip_target" parameter to add vlan tags.
Date: Tue, 16 Sep 2025 08:34:18 -0700	[thread overview]
Message-ID: <20250916083418.7e94a93d@hermes.local> (raw)
In-Reply-To: <20250902211705.2335007-2-wilder@us.ibm.com>

On Tue,  2 Sep 2025 14:15:52 -0700
David Wilder <wilder@us.ibm.com> wrote:

> +			if (RTA_PAYLOAD(iptb[i]) > sizeof(data.addr)) {
> +				num = num + snprintf(&pbuf[num], size - num, "[");
> +
> +				for (level = 0;
> +				     data.vlans[level].vlan_proto != BOND_VLAN_PROTO_NONE;
> +				     level++) {
> +
> +					if (level > BOND_MAX_VLAN_TAGS) {
> +						fprintf(stderr,
> +							"Internal Error: too many vlan tags.\n");
> +						exit(1);
> +					}
> +
> +					if (level != 0)
> +						num = num + snprintf(&pbuf[num], size - num, "/");
> +
> +					num = num + snprintf(&pbuf[num], size - num,
> +							     "%u", data.vlans[level].vlan_id);
> +				}
> +
> +				num = num - snprintf(&pbuf[num], size - num, "]");
> +
> +			}
> +
> +			print_color_string(PRINT_ANY, COLOR_INET, NULL, "%s", pbuf);

This code will display multiple IP's as bracketed text if using JSON.
The more standard way of handling this in JSON would be to use an array.
Could you please rework the display logic to do that.

  reply	other threads:[~2025-09-16 15:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-02 21:15 [PATCH iproute2-next v5 0/1] iproute2-next: Extending bonding's arp_ip_target to include a list of vlan tags David Wilder
2025-09-02 21:15 ` [PATCH iproute2-next v5 1/1] iproute: Extend bonding's "arp_ip_target" parameter to add " David Wilder
2025-09-16 15:34   ` Stephen Hemminger [this message]
2025-09-17 19:00   ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250916083418.7e94a93d@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=amorenoz@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=haliu@redhat.com \
    --cc=i.maximets@ovn.org \
    --cc=jv@jvosburgh.net \
    --cc=netdev@vger.kernel.org \
    --cc=pradeep@us.ibm.com \
    --cc=pradeeps@linux.vnet.ibm.com \
    --cc=wilder@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).