]> git.itanic.dy.fi Git - linux-stable/commit
bonding: fix ns validation on backup slaves
authorHangbin Liu <liuhangbin@gmail.com>
Thu, 6 Apr 2023 08:23:50 +0000 (16:23 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Apr 2023 07:47:20 +0000 (08:47 +0100)
commit4598380f9c548aa161eb4e990a1583f0a7d1e0d7
tree9fee75fc7cc67dc80161e1c5f99b13cd33f3fc16
parentdc5110c2d959c1707e12df5f792f41d90614adaa
bonding: fix ns validation on backup slaves

When arp_validate is set to 2, 3, or 6, validation is performed for
backup slaves as well. As stated in the bond documentation, validation
involves checking the broadcast ARP request sent out via the active
slave. This helps determine which slaves are more likely to function in
the event of an active slave failure.

However, when the target is an IPv6 address, the NS message sent from
the active interface is not checked on backup slaves. Additionally,
based on the bond_arp_rcv() rule b, we must reverse the saddr and daddr
when checking the NS message.

Note that when checking the NS message, the destination address is a
multicast address. Therefore, we must convert the target address to
solicited multicast in the bond_get_targets_ip6() function.

Prior to the fix, the backup slaves had a mii status of "down", but
after the fix, all of the slaves' mii status was updated to "UP".

Fixes: 4e24be018eb9 ("bonding: add new parameter ns_targets")
Reviewed-by: Jonathan Toppins <jtoppins@redhat.com>
Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c
include/net/bonding.h