On Wed, Mar 26, 2025 at 6:22 PM Antonio Quartulli <[email protected]> wrote: > >> This is not what we want. > > > > Got it. You could replace it with > > atomic_fetch_add_unless(&pid->seq_num, 1, 0) and check if it wraps > > around to zero. > > What about the first time when seq_num is 0? It will already stop, no?
The initial value of seq_num is 1.
> +void ovpn_pktid_xmit_init(struct ovpn_pktid_xmit *pid)
> +{
> + atomic64_set(&pid->seq_num, 1);
> +}

