From: Juha Heljoranta <juha.heljoranta@evtek.fi>
To: Nick Hay <nickjhay@hotmail.com>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: Extending LOG target to display pid
Date: Tue, 05 Jul 2005 21:05:31 +0300 [thread overview]
Message-ID: <42CACBEB.9070901@evtek.fi> (raw)
In-Reply-To: <42CAAFE2.3050606@hotmail.com>
Nick Hay wrote:
> 2. Any ideas on how I can get the pid of a local packet's creator in the
> log module? I couldn't find any structures connected to the sk_buff
> that might contain it, and couldn't think of where the data would
> originally come from.
You can copy-paste code from the owner match extension to LOG target to
implement it.
In short, you can do it but to make it pretty requires lot of work (and
knowledge).
You might find this helpful:
http://www.fsfe.org/Members/juha/thesis/thesis.pdf
FYI The owner match extension is just betting when it locates the packet
owner. Although, I admit that it bets right in ~99% of cases... :)
Some body at the netfilter-devel might known could the "socket hooks" be
used:
https://lists.netfilter.org/pipermail/netfilter-devel/2005-May/thread.html#19654
> Actually... would current->pid work?
No. The netfilter code executes quite often in interrupt context (e.g.
when sending tcp syn packets). The current macro might or might not
point to task that sends data.
Regards,
Juha Heljoranta
next prev parent reply other threads:[~2005-07-05 18:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-05 16:05 Extending LOG target to display pid Nick Hay
2005-07-05 17:28 ` Tobias DiPasquale
2005-07-05 18:05 ` Juha Heljoranta [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-07-05 23:56 Nick Hay
2005-07-07 6:32 ` Jonas Berlin
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=42CACBEB.9070901@evtek.fi \
--to=juha.heljoranta@evtek.fi \
--cc=netfilter-devel@lists.netfilter.org \
--cc=nickjhay@hotmail.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 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.