]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bonding: set random address only when slaves already exist
authorHangbin Liu <liuhangbin@gmail.com>
Wed, 10 Sep 2025 02:43:34 +0000 (02:43 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Sep 2025 09:13:43 +0000 (11:13 +0200)
commit9a958802080cdd46848972bb9ec652b91c2a7b29
tree3f174e40a3456c2896271322fc1545c192795d8b
parent660b2a8f5a306a28c7efc1b4990ecc4912a68f87
bonding: set random address only when slaves already exist

[ Upstream commit 35ae4e86292ef7dfe4edbb9942955c884e984352 ]

After commit 5c3bf6cba791 ("bonding: assign random address if device
address is same as bond"), bonding will erroneously randomize the MAC
address of the first interface added to the bond if fail_over_mac =
follow.

Correct this by additionally testing for the bond being empty before
randomizing the MAC.

Fixes: 5c3bf6cba791 ("bonding: assign random address if device address is same as bond")
Reported-by: Qiuling Ren <qren@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Link: https://patch.msgid.link/20250910024336.400253-1-liuhangbin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/bonding/bond_main.c