Re: pf: u_int32_t conn counter underflow in pf_src_tree_remove_state()
Alexandr Nedvedicky <[email protected]>
| Newsgroups | gmane.os.openbsd.tech |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Aug 18, 2026 at 05:57:23PM +0200, Alexander Bluhm wrote:
> On Tue, Aug 18, 2026 at 05:01:58PM +0200, Alexandr Nedvedicky wrote:
</snip>
> > >
> > > The overflow check is reading the sn->conn value independent from the
> > > atomic increment. Something like this is better:
> > >
> > > uint32_t sn_conn;
> > >
> > > sn_conn = atomic_inc_int_nv(&sn->conn);
> > do you mind if I do '(u_int32_t)atomic_inc_int_nv(..);'
>
> The compiler does the right thing. The cast is unnecessary.
OK I will commit the diff without cast.
>
> > updated diff is below.
>
> OK bluhm@
thanks and
regards
sashan