Thread (22 messages) 22 messages, 4 authors, 2025-09-10

Re: [PATCH net-next v10 6/7] bonding: Update for extended arp_ip_target format.

From: Nikolay Aleksandrov <razor@blackwall.org>
Date: 2025-09-09 18:45:09

On 9/5/25 01:18, David Wilder wrote:
Updated bond_fill_info() to support extended arp_ip_target format.

Forward and backward compatibility between the kernel and iprout2 is
iproute2
quoted hunk ↗ jump to hunk
preserved.

Signed-off-by: David Wilder <redacted>
---
  drivers/net/bonding/bond_netlink.c | 30 +++++++++++++++++++++++++-----
  1 file changed, 25 insertions(+), 5 deletions(-)
diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
index 28ee50ddf4e2..1f0d3269a0b1 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -660,6 +660,7 @@ static int bond_fill_info(struct sk_buff *skb,
  			  const struct net_device *bond_dev)
  {
  	struct bonding *bond = netdev_priv(bond_dev);
+	struct bond_arp_target *arptargets;
  	unsigned int packets_per_slave;
  	int ifindex, i, targets_added;
  	struct nlattr *targets;
@@ -698,12 +699,31 @@ static int bond_fill_info(struct sk_buff *skb,
  		goto nla_put_failure;
  
  	targets_added = 0;
-	for (i = 0; i < BOND_MAX_ARP_TARGETS; i++) {
-		if (bond->params.arp_targets[i].target_ip) {
-			if (nla_put_be32(skb, i, bond->params.arp_targets[i].target_ip))
-				goto nla_put_failure;
-			targets_added = 1;
+
+	arptargets = bond->params.arp_targets;
+	for (i = 0; i < BOND_MAX_ARP_TARGETS && arptargets[i].target_ip ; i++) {
+		struct Data {
+			__be32 addr;
+			struct bond_vlan_tag vlans[BOND_MAX_VLAN_TAGS];
+		} __packed data;
+		int level, size;
+
+		data.addr = arptargets[i].target_ip;
+		size = sizeof(__be32);
+		targets_added = 1;
+
+		if (arptargets[i].flags & BOND_TARGET_USERTAGS) {
+			for (level = 0; level < BOND_MAX_VLAN_TAGS ; level++) {
+				data.vlans[level].vlan_proto = arptargets[i].tags[level].vlan_proto;
+				data.vlans[level].vlan_id = arptargets[i].tags[level].vlan_id;
+				size = size + sizeof(struct bond_vlan_tag);
+				if (arptargets[i].tags[level].vlan_proto == BOND_VLAN_PROTO_NONE)
+					break;
+				}
indent seems off
  		}
+
+		if (nla_put(skb, i, size, &data))
+			goto nla_put_failure;
  	}
  
  	if (targets_added)
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help