public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] bonding: fix incorrect mac address setting
@ 2025-02-05  8:03 Hangbin Liu
  2025-02-05  8:03 ` [PATCH net 1/2] bonding: fix incorrect MAC address setting to receive NA messages Hangbin Liu
  2025-02-05  8:03 ` [PATCH net 2/2] selftests: bonding: fix incorrect mac address Hangbin Liu
  0 siblings, 2 replies; 4+ messages in thread
From: Hangbin Liu @ 2025-02-05  8:03 UTC (permalink / raw)
  To: netdev
  Cc: Jay Vosburgh, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Nikolay Aleksandrov, Simon Horman,
	Jianbo Liu, Boris Pismenny, Tariq Toukan, Shuah Khan,
	linux-kselftest, linux-kernel, Hangbin Liu

The mac address on backup slave should be convert from Solicited-Node
Multicast address, not from bonding unicast target address.

Hangbin Liu (2):
  bonding: fix incorrect MAC address setting to receive NA messages
  selftests: bonding: fix incorrect mac address

 drivers/net/bonding/bond_options.c                          | 4 +++-
 tools/testing/selftests/drivers/net/bonding/bond_options.sh | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

-- 
2.39.5 (Apple Git-154)


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

* [PATCH net 1/2] bonding: fix incorrect MAC address setting to receive NA messages
  2025-02-05  8:03 [PATCH net 0/2] bonding: fix incorrect mac address setting Hangbin Liu
@ 2025-02-05  8:03 ` Hangbin Liu
  2025-02-05 12:01   ` Hangbin Liu
  2025-02-05  8:03 ` [PATCH net 2/2] selftests: bonding: fix incorrect mac address Hangbin Liu
  1 sibling, 1 reply; 4+ messages in thread
From: Hangbin Liu @ 2025-02-05  8:03 UTC (permalink / raw)
  To: netdev
  Cc: Jay Vosburgh, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Nikolay Aleksandrov, Simon Horman,
	Jianbo Liu, Boris Pismenny, Tariq Toukan, Shuah Khan,
	linux-kselftest, linux-kernel, Hangbin Liu

In order to receive the neighbor solicitation messages on the backup slave,
we should add the NS target's corresponding MAC address. But the target in
bonding is a unicast addresses. We can't use it directly. Instead, we should
convert it to a Solicited-Node Multicast Address first and then convert
the multicast address to the right MAC address.

Fixes: 8eb36164d1a6 ("bonding: add ns target multicast address to slave device")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 drivers/net/bonding/bond_options.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index 327b6ecdc77e..63cf209dcdc9 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -1246,6 +1246,7 @@ static void slave_set_ns_maddrs(struct bonding *bond, struct slave *slave, bool
 {
 	struct in6_addr *targets = bond->params.ns_targets;
 	char slot_maddr[MAX_ADDR_LEN];
+	struct in6_addr mcaddr;
 	int i;
 
 	if (!slave_can_set_ns_maddr(bond, slave))
@@ -1255,7 +1256,8 @@ static void slave_set_ns_maddrs(struct bonding *bond, struct slave *slave, bool
 		if (ipv6_addr_any(&targets[i]))
 			break;
 
-		if (!ndisc_mc_map(&targets[i], slot_maddr, slave->dev, 0)) {
+		addrconf_addr_solict_mult(&targets[i], &mcaddr);
+		if (!ndisc_mc_map(&mcaddr, slot_maddr, slave->dev, 0)) {
 			if (add)
 				dev_mc_add(slave->dev, slot_maddr);
 			else
-- 
2.39.5 (Apple Git-154)


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

* [PATCH net 2/2] selftests: bonding: fix incorrect mac address
  2025-02-05  8:03 [PATCH net 0/2] bonding: fix incorrect mac address setting Hangbin Liu
  2025-02-05  8:03 ` [PATCH net 1/2] bonding: fix incorrect MAC address setting to receive NA messages Hangbin Liu
@ 2025-02-05  8:03 ` Hangbin Liu
  1 sibling, 0 replies; 4+ messages in thread
From: Hangbin Liu @ 2025-02-05  8:03 UTC (permalink / raw)
  To: netdev
  Cc: Jay Vosburgh, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Nikolay Aleksandrov, Simon Horman,
	Jianbo Liu, Boris Pismenny, Tariq Toukan, Shuah Khan,
	linux-kselftest, linux-kernel, Hangbin Liu

The correct mac address for NS target 2001:db8::254 is 33:33:ff:00:02:54,
not 33:33:00:00:02:54. The same with client maddress.

Fixes: 86fb6173d11e ("selftests: bonding: add ns multicast group testing")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 tools/testing/selftests/drivers/net/bonding/bond_options.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/drivers/net/bonding/bond_options.sh b/tools/testing/selftests/drivers/net/bonding/bond_options.sh
index edc56e2cc606..7bc148889ca7 100755
--- a/tools/testing/selftests/drivers/net/bonding/bond_options.sh
+++ b/tools/testing/selftests/drivers/net/bonding/bond_options.sh
@@ -11,8 +11,8 @@ ALL_TESTS="
 
 lib_dir=$(dirname "$0")
 source ${lib_dir}/bond_topo_3d1c.sh
-c_maddr="33:33:00:00:00:10"
-g_maddr="33:33:00:00:02:54"
+c_maddr="33:33:ff:00:00:10"
+g_maddr="33:33:ff:00:02:54"
 
 skip_prio()
 {
-- 
2.39.5 (Apple Git-154)


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

* Re: [PATCH net 1/2] bonding: fix incorrect MAC address setting to receive NA messages
  2025-02-05  8:03 ` [PATCH net 1/2] bonding: fix incorrect MAC address setting to receive NA messages Hangbin Liu
@ 2025-02-05 12:01   ` Hangbin Liu
  0 siblings, 0 replies; 4+ messages in thread
From: Hangbin Liu @ 2025-02-05 12:01 UTC (permalink / raw)
  To: netdev
  Cc: Jay Vosburgh, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Nikolay Aleksandrov, Simon Horman,
	Jianbo Liu, Boris Pismenny, Tariq Toukan, Shuah Khan,
	linux-kselftest, linux-kernel


Oh, I just found the subject is incorrect. We want to receive the NS
message, not NA message on backup slaves.

Thanks
Hangbin
On Wed, Feb 05, 2025 at 08:03:35AM +0000, Hangbin Liu wrote:
> In order to receive the neighbor solicitation messages on the backup slave,
> we should add the NS target's corresponding MAC address. But the target in
> bonding is a unicast addresses. We can't use it directly. Instead, we should
> convert it to a Solicited-Node Multicast Address first and then convert
> the multicast address to the right MAC address.
> 
> Fixes: 8eb36164d1a6 ("bonding: add ns target multicast address to slave device")
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
>  drivers/net/bonding/bond_options.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
> index 327b6ecdc77e..63cf209dcdc9 100644
> --- a/drivers/net/bonding/bond_options.c
> +++ b/drivers/net/bonding/bond_options.c
> @@ -1246,6 +1246,7 @@ static void slave_set_ns_maddrs(struct bonding *bond, struct slave *slave, bool
>  {
>  	struct in6_addr *targets = bond->params.ns_targets;
>  	char slot_maddr[MAX_ADDR_LEN];
> +	struct in6_addr mcaddr;
>  	int i;
>  
>  	if (!slave_can_set_ns_maddr(bond, slave))
> @@ -1255,7 +1256,8 @@ static void slave_set_ns_maddrs(struct bonding *bond, struct slave *slave, bool
>  		if (ipv6_addr_any(&targets[i]))
>  			break;
>  
> -		if (!ndisc_mc_map(&targets[i], slot_maddr, slave->dev, 0)) {
> +		addrconf_addr_solict_mult(&targets[i], &mcaddr);
> +		if (!ndisc_mc_map(&mcaddr, slot_maddr, slave->dev, 0)) {
>  			if (add)
>  				dev_mc_add(slave->dev, slot_maddr);
>  			else
> -- 
> 2.39.5 (Apple Git-154)
> 

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

end of thread, other threads:[~2025-02-05 12:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-05  8:03 [PATCH net 0/2] bonding: fix incorrect mac address setting Hangbin Liu
2025-02-05  8:03 ` [PATCH net 1/2] bonding: fix incorrect MAC address setting to receive NA messages Hangbin Liu
2025-02-05 12:01   ` Hangbin Liu
2025-02-05  8:03 ` [PATCH net 2/2] selftests: bonding: fix incorrect mac address Hangbin Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox