Skip to contentSkip to conversation

bonding: NS target should accept link local address

PATCH Applied Hangbin Liu 4 participants 4 messages May 27, 2022 – May 28, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bonding: NS target should accept link local address

When setting bond NS target, we use bond_is_ip6_target_ok() to check if the address valid. The link local address was wrongly rejected in bond_changelink(), as most time the user just set the ARP/NS target to gateway, while the IPv6 gateway is always a link local address when user set up interface via SLAAC.

So remove the link local addr check when setting bond NS target.

Fixes 129e3c1bab24 ("bonding: add new option ns_ip6_target")
---
 drivers/net/bonding/bond_netlink.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/net/bonding/bond_netlink.c +0 -5
index f427fa1737c7..6f404f9c34e3 100644
@@ -290,11 +290,6 @@ static int bond_changelink(struct net_device *bond_dev, struct nlattr *tb[],
 
 			addr6 = nla_get_in6_addr(attr);
 
-			if (ipv6_addr_type(&addr6) & IPV6_ADDR_LINKLOCAL) {
-				NL_SET_ERR_MSG(extack, "Invalid IPv6 addr6");
-				return -EINVAL;
-			}
-
 			bond_opt_initextra(&newval, &addr6, sizeof(addr6));
 			err = __bond_opt_set(bond, BOND_OPT_NS_TARGETS,
 					     &newval);
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Hangbin Liu

When setting bond NS target, we use bond_is_ip6_target_ok() to check if the address valid. The link local address was wrongly rejected in bond_changelink(), as most time the user just set the ARP/NS target to gateway, while the IPv6 gateway is always a link local address when user set up interface via SLAAC.

So remove the link local addr check when setting bond NS target.

Fixes 129e3c1bab24 ("bonding: add new option ns_ip6_target")
Acked-by on v1 1/1
#2 lore raw
In reply to Hangbin Liu
Quoted 11 lines · Hangbin Liu

When setting bond NS target, we use bond_is_ip6_target_ok() to check if the address valid. The link local address was wrongly rejected in bond_changelink(), as most time the user just set the ARP/NS target to gateway, while the IPv6 gateway is always a link local address when user set up interface via SLAAC.

So remove the link local addr check when setting bond NS target.

Fixes 129e3c1bab24 ("bonding: add new option ns_ip6_target")
Quoted 23 lines

---
drivers/net/bonding/bond_netlink.c | 5 -----

1 file changed, 5 deletions(-)
drivers/net/bonding/bond_netlink.c +0 -5
index f427fa1737c7..6f404f9c34e3 100644
@@ -290,11 +290,6 @@ static int bond_changelink(struct net_device *bond_dev, struct nlattr *tb[],
 
 			addr6 = nla_get_in6_addr(attr);
 
-			if (ipv6_addr_type(&addr6) & IPV6_ADDR_LINKLOCAL) {
-				NL_SET_ERR_MSG(extack, "Invalid IPv6 addr6");
-				return -EINVAL;
-			}
-
 			bond_opt_initextra(&newval, &addr6, sizeof(addr6));
 			err = __bond_opt_set(bond, BOND_OPT_NS_TARGETS,
 					     &newval);
Signature · 1 line
2.35.1
#3 lore raw
In reply to Hangbin Liu
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:

Quoted 9 lines · On Fri, 27 May 2022 14:44:39 +0800 you wrote:

When setting bond NS target, we use bond_is_ip6_target_ok() to check if the address valid. The link local address was wrongly rejected in bond_changelink(), as most time the user just set the ARP/NS target to gateway, while the IPv6 gateway is always a link local address when user set up interface via SLAAC.

So remove the link local addr check when setting bond NS target.

[...]

Here is the summary with links:
- [net] bonding: NS target should accept link local address

    https://git.kernel.org/netdev/net/c/5e1eeef69c0f

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html