Re: [PATCH net-next v10 4/7] bonding: Processing extended arp_ip_target from user space.
From: Paolo Abeni <pabeni@redhat.com>
Date: 2025-09-09 13:37:45
On 9/5/25 12:18 AM, David Wilder wrote:
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c index cf4cb301a738..61334633403d 100644 --- a/drivers/net/bonding/bond_options.c +++ b/drivers/net/bonding/bond_options.c@@ -31,8 +31,8 @@ static int bond_option_use_carrier_set(struct bonding *bond, const struct bond_opt_value *newval); static int bond_option_arp_interval_set(struct bonding *bond, const struct bond_opt_value *newval); -static int bond_option_arp_ip_target_add(struct bonding *bond, __be32 target); -static int bond_option_arp_ip_target_rem(struct bonding *bond, __be32 target); +static int bond_option_arp_ip_target_add(struct bonding *bond, struct bond_arp_target target); +static int bond_option_arp_ip_target_rem(struct bonding *bond, struct bond_arp_target target);
Above and elsewhere: 'struct bond_arp_target' -> 'const struct bond_arp_target *' Side note, I replied by mistake to older revision of this series: https://lore.kernel.org/netdev/dbc791a9-7b87-42a8-abba-fa63e5812008@redhat.com/T/#u (local) https://lore.kernel.org/netdev/8c0b5b0a-60ee-4ed4-b439-11d5c106ac6e@redhat.com/T/#u (local) https://lore.kernel.org/netdev/add4dcf4-b3c2-40dd-bc2f-de80619e7c6f@redhat.com/T/#u (local) but the comments there apply to v10.
quoted hunk ↗ jump to hunk
@@ -1214,30 +1216,77 @@ static int bond_option_arp_ip_target_rem(struct bonding *bond, __be32 target) targets_rx[i] = targets_rx[i+1]; targets_rx[i] = 0; } - for (i = ind; (i < BOND_MAX_ARP_TARGETS - 1) && targets[i + 1].target_ip; i++) - targets[i] = targets[i+1]; + + bond_free_vlan_tag(&targets[ind]); + + for (i = ind; (i < BOND_MAX_ARP_TARGETS - 1) && targets[i + 1].target_ip; i++) { + targets[i].target_ip = targets[i + 1].target_ip; + targets[i].tags = targets[i + 1].tags; + targets[i].flags = targets[i + 1].flags; + } targets[i].target_ip = 0; + targets[i].flags = 0; + targets[i].tags = NULL;
The above chunk of code is repeated elsewhere. Possibly factoring out the initialization in an helper could be useful. /P