netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Gomathivinayagam Muthuvinayagam <sankarmail@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: ulogd - polling handler - code clarification
Date: Tue, 31 Jul 2012 13:27:56 +0200	[thread overview]
Message-ID: <20120731112756.GA3698@1984> (raw)
In-Reply-To: <CAAJpzgbKeTz2=Qsf035TSDQ19rvbLxnA2AcwFLHKDSXzZYZtkQ@mail.gmail.com>

On Mon, Jul 30, 2012 at 03:18:32PM -0700, Gomathivinayagam Muthuvinayagam wrote:
> Hi,
> 
> I was going through the ulogd_inpflow_NFCT.c : polling_handler code. I
> need few clarifications.
> If someone can answer for that, that will be great.
> 
> 
>  725         case NFCT_T_UPDATE:
>  726                 id = hashtable_hash(cpi->ct_active, ct);
>  727                 ts = (struct ct_timestamp *)
>  728                         hashtable_find(cpi->ct_active, ct, id);
>  729                 if (ts)
>  730                         nfct_copy(ts->ct, ct, NFCT_CP_META);
>  731                 else {
>  732                         ts = calloc(sizeof(struct ct_timestamp), 1);
>  733                         if (ts == NULL)
>  734                                 return NFCT_CB_CONTINUE;
>  735
>  736                         ts->ct = ct;
>  737                         gettimeofday(&ts->time[START], NULL);
>  738
>  739                         ret = hashtable_add(cpi->ct_active,
> &ts->hashnode, id);
>  740                         if (ret < 0) {
>  741                                 free(ts);
>  742                                 return NFCT_CB_CONTINUE;
>  743                         }
>  744                         return NFCT_CB_STOLEN; // Here, why not
> NFCT_CB_CONTINUE is used?
>  745                 }
>  746                 break;
> 
> Here in Line no 744, why NFCT_CB_STOLEN is used instead of
> NFCT_CB_CONTINUE ? I am not able to understand the reason.

NFCT_CB_STOLEN means that the object is not released once the callback
code is done.

That object is released once we notice that the entry is not there in
the kernel anymore.

      reply	other threads:[~2012-07-31 11:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-30 22:18 ulogd - polling handler - code clarification Gomathivinayagam Muthuvinayagam
2012-07-31 11:27 ` Pablo Neira Ayuso [this message]

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=20120731112756.GA3698@1984 \
    --to=pablo@netfilter.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=sankarmail@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).