Re: [PATCH net] macvlan: fix passthru promiscuity accounting while down

From: Hangbin Liu

Date: Fri Oct 23 2026 - 03:59:29 EST


On Fri, Oct 23, 2026 at 02:16:30PM +0800, Xia Yan wrote:
> Hi Hangbin,
>
> > If we discard the MACVLAN_FLAG_NOPROMISC change, should we remove the bit
> > before calling WRITE_ONCE(vlan->flags, flags)?
>
> WRITE_ONCE() still saves the new flags. The patch only skips the
> lower device's promiscuity count update while the macvlan is down.
>
> If NOPROMISC is cleared while down, macvlan_open() takes the
> reference on the next open and macvlan_stop() releases it. If it is
> set while down, the next open leaves the lower device's count alone.
>
> I'd keep saving the requested flags. Clearing the bit would lose
> the user's setting. Rejecting the update would require bringing the
> interface up before changing this option.

Ah, I see. Thanks.

Reviewed-by: Hangbin Liu <liuhangbin@xxxxxxxxxx>