Hello, On Tue, Mar 15, 2022 at 12:58:48AM +0300, Vitaliy Makkoveev wrote: </snip> > > > > I think local var `ipa` needs to be initialized to NULL > > to avoid random value/pointer when no `ipa` for given `seq` > > is found. > > > > ipsp_pending_acquire() plays the same gamble. > > #define TAILQ_FOREACH(var, head, field) \ > for((var) = TAILQ_FIRST(head); \ > (var) != TAILQ_END(head); \ > (var) = TAILQ_NEXT(var, field)) > > TAILQ_END() defined as NULL. So it will be NULL when the > whole `ipsec_acquire_head’ was processed but `ipa’ was > not found. > > Also the initial `ipa’ value will be overwritten within > the TAILQ_FOREACH() loop processing. In all cases.
I see now. you are absolutely right. I don't insist on those tweaks any more. thanks and regards sashan