netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Eric Leblond <eric@inl.fr>
Cc: kaber@trash.net, netfilter-devel@vger.kernel.org
Subject: Re: [RFC] make thread-safe iface resolution in libnfnetlink
Date: Wed, 29 Apr 2009 02:01:47 +0200	[thread overview]
Message-ID: <49F798EB.3050203@netfilter.org> (raw)
In-Reply-To: <1240955127-13723-1-git-send-email-eric@inl.fr>

Eric Leblond wrote:
> Hi,
> 
> I've encountered some problems with libnfnetlink iface resolution on a
> system where some interfaces are getting up and down: NuFW which uses
> this feature has crashed during a down/up of an interfaces. One of
> the reason seems that nufw uses one thread is used for iface related
> event treatment and another thread is doing iface name resolution.
> 
> As the hash can be modified or read without any lock, I think the
> problem can be linked with this issue. I thus propose a patch that
> modifies the iface resolution subsystem to make it thread-safe.

Better do the locking in your application. You can define the lock in
NuFW and protect the calls to libnfnetlink's interface API. Adding this
locking to a library does not seem to me like the right thing, see that
other non-threaded clients will have to live with the overhead of this
lock that is completely useless for them. Of course, we can document
that the interface API is not thread-safe.

I'm rewriting libnfnetlink from scratch (libnfnetlink2?) considering
this and other existing issues. I think that we can have better a
thread-safe interface API soon. Stay tuned.

-- 
"Los honestos son inadaptados sociales" -- Les Luthiers

  parent reply	other threads:[~2009-04-29  0:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-28 21:45 [RFC] make thread-safe iface resolution in libnfnetlink Eric Leblond
2009-04-28 21:45 ` [PATCH] iftable: make library thread-safe Eric Leblond
2009-04-29  0:01 ` Pablo Neira Ayuso [this message]
2009-05-05 13:23   ` [RFC] make thread-safe iface resolution in libnfnetlink Patrick McHardy

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=49F798EB.3050203@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=eric@inl.fr \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    /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).