Re: [PATCH net] bonding: use permanent address for MAC swapping if device address is same

From: Jakub Kicinski
Date: Wed Mar 26 2025 - 07:32:24 EST


On Wed, 26 Mar 2025 10:22:58 +0000 Hangbin Liu wrote:
> > I don't know much about bonding, but this seems like a problem already
> > to me. Assuming both eth0 and eth1 are on the same segment we now have
> > two interfaces with the same MAC on the network. Shouldn't we override
> > the address of eth0 to a random one when it leaves?
>
> Can we change an interface mac to random value after leaving bond's control?
> It looks may break user's other configures.

Hard to speculate but leaving two interfaces with the same MAC is even
worse? I guess nobody hit this problem in practice.

> > looks like this is on ctrl path, just always use memcmp directly ?
> > not sure if this helper actually.. helps.
>
> This is just to align with bond_hw_addr_copy(). If you think it's not help.
> I can use memcmp() directly.

Yes, I don't think it helps.