All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.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,
	stephen@networkplumber.org
Subject: Re: [PATCH net-next v8 4/7] bonding: Processing extended arp_ip_target from user space.
Date: Fri, 29 Aug 2025 14:18:50 +0100	[thread overview]
Message-ID: <20250829131850.GK31759@horms.kernel.org> (raw)
In-Reply-To: <20250828221859.2712197-5-wilder@us.ibm.com>

On Thu, Aug 28, 2025 at 03:18:06PM -0700, David Wilder wrote:
> Changes to bond_netlink and bond_options to process extended
> format arp_ip_target option sent from user space via the ip
> command.
> 
> The extended format adds a list of vlan tags to the ip target address.
> 
> Signed-off-by: David Wilder <wilder@us.ibm.com>

...

> diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c

...

> +/**
> + * bond_validate_tags - validate an array of bond_vlan_tag.
> + * @tags: the array to validate
> + * @len: the length in bytes of @tags
> + *
> + * Validate that @tags points to a valid array of struct bond_vlan_tag.
> + * Returns the length of the validated bytes in the array or -1 if no
> + * valid list is found.
> + */
> +static int bond_validate_tags(struct bond_vlan_tag *tags, size_t len)
> +{
> +	size_t i, ntags = 0;
> +
> +	if (len == 0 || !tags)
> +		return 0;
> +
> +	for (i = 0; i <= len; i = i + sizeof(struct bond_vlan_tag)) {
> +		if (ntags > BOND_MAX_VLAN_TAGS)
> +			break;

Hi David,

BOND_MAX_VLAN_TAGS is used here but it isn't defined until a subsequent
patch in this series. Which breaks bisection.

I didn't check, but probably this can be addressed by moving
the definition of BOND_MAX_VLAN_TAGS to this patch.

> +
> +		if (tags->vlan_proto == BOND_VLAN_PROTO_NONE)
> +			return i + sizeof(struct bond_vlan_tag);
> +
> +		if (tags->vlan_id > 4094)
> +			break;
> +		tags++;
> +		ntags++;
> +	}
> +	return -1;
>  }

...

-- 
pw-bot: changes-requested

  reply	other threads:[~2025-08-29 13:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-28 22:18 [PATCH net-next v8 0/7] bonding: Extend arp_ip_target format to allow for a list of vlan tags David Wilder
2025-08-28 22:18 ` [PATCH net-next v8 1/7] bonding: Adding struct bond_arp_target David Wilder
2025-08-28 22:18 ` [PATCH net-next v8 2/7] bonding: Adding extra_len field to struct bond_opt_value David Wilder
2025-08-28 22:18 ` [PATCH net-next v8 3/7] bonding: arp_ip_target helpers David Wilder
2025-08-28 22:18 ` [PATCH net-next v8 4/7] bonding: Processing extended arp_ip_target from user space David Wilder
2025-08-29 13:18   ` Simon Horman [this message]
2025-08-28 22:18 ` [PATCH net-next v8 5/7] bonding: Update to bond_arp_send_all() to use supplied vlan tags David Wilder
2025-08-28 22:18 ` [PATCH net-next v8 6/7] bonding: Update for extended arp_ip_target format David Wilder
2025-08-28 22:18 ` [PATCH net-next v8 7/7] bonding: Selftest and documentation for the arp_ip_target parameter David Wilder

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=20250829131850.GK31759@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=amorenoz@redhat.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=stephen@networkplumber.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.