Subject: Re: [net-next,4/9] ipvs: do not keep dest_dst after dest is removed

From: Jakub Kicinski <[email-masked]>
Date: Wed, 25 Feb 2026 19:44:49 -0800

On Wed, 25 Feb 2026 19:41:24 -0800 Jakub Kicinski wrote:
> > -			if (!rt_dev_is_down(dst_dev_rcu(&rt->dst)))
> > +			if (!rt_dev_is_down(dst_dev_rcu(&rt->dst)) &&
> > +			    dest->flags & IP_VS_DEST_F_AVAILABLE)
> >  				__ip_vs_dst_set(dest, dest_dst, &rt->dst, 0);  
> 
> Should this be wrapped in parentheses?
> 
> In C operator precedence, the logical AND (&&) binds more tightly than
> the bitwise AND (&). The expression here parses as:
> 
>     (!rt_dev_is_down(...) && dest->flags) & IP_VS_DEST_F_AVAILABLE
> 
> This works correctly only because IP_VS_DEST_F_AVAILABLE is 0x0001, and
> the logical AND produces 0 or 1, so the bitwise AND with 0x0001 still
> produces the expected result.

Ah, should have skipped this one. It is of course bs. Chris reported 
it to the developers of the model.