From: jamal <hadi@cyberus•ca>
To: Patrick McHardy <kaber@trash•net>
Cc: David Miller <davem@davemloft•net>, netdev@vger•kernel.org
Subject: Re: [XFRM] Optimize SA dumping
Date: Mon, 04 Dec 2006 08:27:46 -0500 [thread overview]
Message-ID: <1165238866.3664.43.camel@localhost> (raw)
In-Reply-To: <4574164B.1000505@trash.net>
On Mon, 2006-04-12 at 13:36 +0100, Patrick McHardy wrote:
> jamal wrote:
> > for (i = 0; i <= xfrm_state_hmask; i++) {
> > hlist_for_each_entry(x, entry, xfrm_state_bydst+i, bydst) {
> > + if (count && send_x != last_x) {
> > + err = func(send_x, count, data);
> > + if (err)
> > + goto out;
> > + send_x = NULL;
> > + }
> > if (!xfrm_id_proto_match(x->id.proto, proto))
> > continue;
>
> After you sent send_x and set it to NULL, it will be different from
> last_x (since that is != NULL) and the NULL pointer will be given
> to func() when continuing here.
>
This one you lost me. Can you give me an example? one or two SAs found?
In any case, if i go the done callback approach, I can get rid of all
this tracking thing ...
cheers,
jamal
> > - err = func(x, --count, data);
> > - if (err)
> > - goto out;
> > +
> > + if (!count) {
> > + last_x = send_x = x;
> > + } else {
> > + send_x = last_x;
> > + last_x = x;
> > + }
> > + count++;
> > }
> > }
>
>
>
>
next prev parent reply other threads:[~2006-12-04 13:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-03 16:33 [XFRM] Optimize SA dumping jamal
2006-12-04 12:36 ` Patrick McHardy
2006-12-04 13:27 ` jamal [this message]
2006-12-04 13:39 ` Patrick McHardy
2006-12-04 13:55 ` jamal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1165238866.3664.43.camel@localhost \
--to=hadi@cyberus$(echo .)ca \
--cc=davem@davemloft$(echo .)net \
--cc=kaber@trash$(echo .)net \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox