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

From: Hangbin Liu
Date: Wed Mar 26 2025 - 10:20:41 EST


On Wed, Mar 26, 2025 at 04:32:13AM -0700, Jakub Kicinski wrote:
> 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.

It's the default behavior for bonding as bond will take the first link's
MAC address. If release the first link, then we will have 2 interfaces (bond
and first link) has same MAC address.

Usually, People doesn't release the link after adding to bond, but it do happens.

Hi Jay, any comments?

Thanks
Hangbin