All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] bonding: NS target should accept link local address
@ 2022-05-27  6:44 Hangbin Liu
  2022-05-27 14:05 ` Jonathan Toppins
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Hangbin Liu @ 2022-05-27  6:44 UTC (permalink / raw)
  To: netdev
  Cc: Jay Vosburgh, Veaceslav Falico, Andy Gospodarek,
	David S . Miller, Jakub Kicinski, Jonathan Toppins, Eric Dumazet,
	Paolo Abeni, Hangbin Liu, Li Liang

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")
Reported-by: Li Liang <liali@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 drivers/net/bonding/bond_netlink.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
index f427fa1737c7..6f404f9c34e3 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -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);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] bonding: NS target should accept link local address
  2022-05-27  6:44 [PATCH net] bonding: NS target should accept link local address Hangbin Liu
@ 2022-05-27 14:05 ` Jonathan Toppins
  2022-05-27 23:28 ` Jay Vosburgh
  2022-05-28 14:40 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Jonathan Toppins @ 2022-05-27 14:05 UTC (permalink / raw)
  To: Hangbin Liu, netdev
  Cc: Jay Vosburgh, Veaceslav Falico, Andy Gospodarek,
	David S . Miller, Jakub Kicinski, Eric Dumazet, Paolo Abeni,
	Li Liang

On 5/27/22 02:44, Hangbin Liu 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.
> 
> Fixes: 129e3c1bab24 ("bonding: add new option ns_ip6_target")
> Reported-by: Li Liang <liali@redhat.com>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>

Reviewed-by: Jonathan Toppins <jtoppins@redhat.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] bonding: NS target should accept link local address
  2022-05-27  6:44 [PATCH net] bonding: NS target should accept link local address Hangbin Liu
  2022-05-27 14:05 ` Jonathan Toppins
@ 2022-05-27 23:28 ` Jay Vosburgh
  2022-05-28 14:40 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Jay Vosburgh @ 2022-05-27 23:28 UTC (permalink / raw)
  To: Hangbin Liu
  Cc: netdev, Veaceslav Falico, Andy Gospodarek, David S . Miller,
	Jakub Kicinski, Jonathan Toppins, Eric Dumazet, Paolo Abeni,
	Li Liang

Hangbin Liu <liuhangbin@gmail.com> 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.
>
>Fixes: 129e3c1bab24 ("bonding: add new option ns_ip6_target")
>Reported-by: Li Liang <liali@redhat.com>
>Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>

Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>


>---
> drivers/net/bonding/bond_netlink.c | 5 -----
> 1 file changed, 5 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
>index f427fa1737c7..6f404f9c34e3 100644
>--- a/drivers/net/bonding/bond_netlink.c
>+++ b/drivers/net/bonding/bond_netlink.c
>@@ -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);
>-- 
>2.35.1
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] bonding: NS target should accept link local address
  2022-05-27  6:44 [PATCH net] bonding: NS target should accept link local address Hangbin Liu
  2022-05-27 14:05 ` Jonathan Toppins
  2022-05-27 23:28 ` Jay Vosburgh
@ 2022-05-28 14:40 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-05-28 14:40 UTC (permalink / raw)
  To: Hangbin Liu
  Cc: netdev, j.vosburgh, vfalico, andy, davem, kuba, jtoppins,
	eric.dumazet, pabeni, liali

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-28 14:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-27  6:44 [PATCH net] bonding: NS target should accept link local address Hangbin Liu
2022-05-27 14:05 ` Jonathan Toppins
2022-05-27 23:28 ` Jay Vosburgh
2022-05-28 14:40 ` patchwork-bot+netdevbpf

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.