]> www.infradead.org Git - users/willy/pagecache.git/commit
bonding: fix incorrect MAC address setting to receive NS messages
authorHangbin Liu <liuhangbin@gmail.com>
Thu, 6 Mar 2025 02:39:22 +0000 (02:39 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 11 Mar 2025 12:19:27 +0000 (13:19 +0100)
commit0c5e145a350de3b38cd5ae77a401b12c46fb7c1d
tree0caf98d3e573fa4d4101736f88e4cce192612071
parentf5d83cf0eeb90fade4d5c4d17d24b8bee9ceeecc
bonding: fix incorrect MAC address setting to receive NS messages

When validation on the backup slave is enabled, we need to validate the
Neighbor Solicitation (NS) messages received on the backup slave. To
receive these messages, the correct destination MAC address must be added
to the slave. However, the target in bonding is a unicast address, which
we cannot use directly. Instead, we should first convert it to a
Solicited-Node Multicast Address and then derive the corresponding MAC
address.

Fix the incorrect MAC address setting on both slave_set_ns_maddr() and
slave_set_ns_maddrs(). Since the two function names are similar. Add
some description for the functions. Also only use one mac_addr variable
in slave_set_ns_maddr() to save some code and logic.

Fixes: 8eb36164d1a6 ("bonding: add ns target multicast address to slave device")
Acked-by: Jay Vosburgh <jv@jvosburgh.net>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250306023923.38777-2-liuhangbin@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/bonding/bond_options.c