From: Pablo Neira Ayuso <pablo@eurodev.net>
To: Guru Prasad <guru_netfilter@yahoo.com>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: Waiting for user space response in Kernel Mode
Date: Mon, 05 Dec 2005 10:52:26 +0100 [thread overview]
Message-ID: <43940DDA.3050908@eurodev.net> (raw)
In-Reply-To: <20051205094858.34850.qmail@web36409.mail.mud.yahoo.com>
Guru Prasad wrote:
> I am a newbie to Kernel and Netfilter development.
>
> When a new connection with specific parameters (for
> example a certain destination IP address) is created,
> I would like to indicate this event to a daemon
> process in user space which takes some decision before
> proceeding. I detect this event from
> ip_conntrack_netlink.c in the following function.
>
> int ctnetlink_conntrack_event(struct notifier_block
> *this,
> unsigned long events, void *ptr) --> "if (events &
> (IPCT_NEW |
> IPCT_RELATED)) {"
>
> When I detect a new connection,I tried to use
> Wait_queues and call schedule() so that I could wait
> on this process before receiving response from user
> space, but using this mechanism leads to crashes. It
> seems that one can only use this mechanism (wait
> queues and schedule) when a process is executing in
> the context of a user space application.
Yes, ctnetlink_conntrack_event is always called from interrupt context.
Don't do that in kernelspace. Use libnetfilter_conntrack and work in
userspace please.
--
Pablo
next prev parent reply other threads:[~2005-12-05 9:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <001801c5f6b3$539b1b20$3478fea9@acer21ce70712f>
2005-12-04 10:26 ` P2P implementation for netfilter NAT Rusty Russell
2005-12-05 8:03 ` Jesse Peng
2005-12-05 9:48 ` Waiting for user space response in Kernel Mode Guru Prasad
2005-12-05 9:52 ` Pablo Neira Ayuso [this message]
2006-01-05 15:52 ` P2P implementation for netfilter NAT Jesse Peng
2006-01-08 1:20 ` Rusty Russell
2006-01-16 16:26 ` Jesse Peng
2006-01-18 10:53 ` Jesse Peng
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=43940DDA.3050908@eurodev.net \
--to=pablo@eurodev.net \
--cc=guru_netfilter@yahoo.com \
--cc=netfilter-devel@lists.netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.