All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Leblond <eric@regit.org>
To: Mehran Kholdi <semekh.dev@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: How to get pid of packet sender from NFQUEUE?
Date: Fri, 03 Jan 2014 09:12:54 +0100	[thread overview]
Message-ID: <1388736774.19005.3.camel@tiger2> (raw)
In-Reply-To: <CAKiFbu9h1an38XXeNDy1ivcEz1vZHaqK+ekmQVXZLUChpJ3pBQ@mail.gmail.com>

Hello,

On Fri, 2014-01-03 at 03:52 +0330, Mehran Kholdi wrote:
> So, I've got my code in userland (using netfilter_queue) that tries to
> handle packets according to different attributes (sort of a firewall).
> Is it possible to get the pid of sender program?
> I'm aware that it is possible to apply pid-based rules with iptables
> directly, but how could I access that property in the NFQUEUE?

You can't for now. Patches to access to UID GID have been made available
recently:
http://www.spinics.net/lists/netfilter-devel/msg29355.html

I don't think it should be too complex to propose the same for PID.

BR,
-- 
Eric Leblond <eric@regit.org>
Blog: https://home.regit.org/


  reply	other threads:[~2014-01-03  8:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-03  0:22 How to get pid of packet sender from NFQUEUE? Mehran Kholdi
2014-01-03  8:12 ` Eric Leblond [this message]
2014-01-04 16:17 ` Mehran Kholdi

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=1388736774.19005.3.camel@tiger2 \
    --to=eric@regit.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=semekh.dev@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 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.