From: Alexandr Nedvedicky Subject: Re: pf: u_int32_t conn counter underflow in pf_src_tree_remove_state() To: Alexander Bluhm Cc: tech@openbsd.org Date: Tue, 18 Aug 2026 18:53:21 +0200 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: > > > > > > 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