From: Pablo Neira Ayuso <pablo@netfilter.org>
To: valentina.giusti@bmw-carit.de
Cc: netfilter-devel@vger.kernel.org, netdev@vger.kernel.org,
jpa@google.com, fw@strnel.de, daniel.wagner@bmw-carit.de
Subject: Re: [PATCH v4 2/2] libnetfilter_queue: add support for UID/GID socket info
Date: Sat, 21 Dec 2013 13:11:26 +0100 [thread overview]
Message-ID: <20131221121126.GA27133@localhost> (raw)
In-Reply-To: <1387556934-7372-3-git-send-email-valentina.giusti@bmw-carit.de>
On Fri, Dec 20, 2013 at 05:28:54PM +0100, valentina.giusti@bmw-carit.de wrote:
> @@ -1180,6 +1183,18 @@ struct nfqnl_msg_packet_hw *nfq_get_packet_hw(struct nfq_data *nfad)
> }
> EXPORT_SYMBOL(nfq_get_packet_hw);
>
> +uint32_t nfq_get_uid(struct nfq_data *nfad)
> +{
> + return ntohl(nfnl_get_data(nfad->data, NFQA_UID, u_int32_t));
> +}
> +EXPORT_SYMBOL(nfq_get_uid);
Given that we'll have cases in which uid would not be present, I think
that the following interface would be better:
int nfq_get_uid(struct nfq_data *nfad, uint32_t *uid)
The function returns 1 if uid has been set (ie. it's available so you
can access it), otherwise it returns 0.
Same thing for _get_gid().
Thanks.
prev parent reply other threads:[~2013-12-21 12:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-20 16:28 [PATCH v4 0/2] Add UID/GID info to NFQUEUE valentina.giusti
2013-12-20 16:28 ` [PATCH v4 1/2] netfilter_queue: enable UID/GID socket info retrieval valentina.giusti
2013-12-23 14:21 ` Pablo Neira Ayuso
2014-01-07 8:11 ` Valentina Giusti
2013-12-20 16:28 ` [PATCH v4 2/2] libnetfilter_queue: add support for UID/GID socket info valentina.giusti
2013-12-21 11:38 ` Pablo Neira Ayuso
2014-01-07 13:30 ` [PATCH 0/2] " valentina.giusti
2014-01-07 13:30 ` [PATCH 1/2] src: " valentina.giusti
2014-01-07 23:42 ` Pablo Neira Ayuso
2014-01-07 13:30 ` [PATCH 2/2] utils: add test for nfq_get_uid and nfq_get_gid valentina.giusti
2014-01-07 23:43 ` Pablo Neira Ayuso
2014-01-08 9:36 ` Valentina Giusti
2013-12-21 12:11 ` 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=20131221121126.GA27133@localhost \
--to=pablo@netfilter.org \
--cc=daniel.wagner@bmw-carit.de \
--cc=fw@strnel.de \
--cc=jpa@google.com \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=valentina.giusti@bmw-carit.de \
/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).