From: Eric Leblond <eric@inl.fr>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: [PATCH 1/2] Specify nf_queue max length from userspace
Date: Mon, 19 Jun 2006 21:57:10 +0200 [thread overview]
Message-ID: <1150747030.6979.6.camel@porky> (raw)
In-Reply-To: <4496D030.1010400@trash.net>
[-- Attachment #1.1: Type: text/plain, Size: 769 bytes --]
Hi,
> > @@ -75,6 +76,7 @@ enum nfqnl_config_mode {
> > struct nfqnl_msg_config_params {
> > u_int32_t copy_range;
> > u_int8_t copy_mode; /* enum nfqnl_config_mode */
> > + u_int32_t queue_maxlen;
> > } __attribute__ ((packed));
>
> This too. Why not just use a new attribute?
I did not like the idea of having params split between two structures.
And as the user base is still small, I thought we may break ABI to have
something cleaner.
Pablo and you do not like the idea, I wrote a patch that should not
break the ABI (attached to the mail).
In fact, after introducing the new attribute, I just found it is in a
way cleaner than my initial one because code does not depend from a
structure.
BR,
--
Eric Leblond <eric@inl.fr>
INL
[-- Attachment #1.2: specify-queue-max-length-from-userspace.patch --]
[-- Type: text/x-patch, Size: 1224 bytes --]
------------------------------------------------------------------------
Signed-off-by: Eric Leblond <eric@inl.fr>
---
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h
index 9e77437..22ffac0 100644
--- a/include/linux/netfilter/nfnetlink_queue.h
+++ b/include/linux/netfilter/nfnetlink_queue.h
@@ -82,6 +82,7 @@ enum nfqnl_attr_config {
NFQA_CFG_UNSPEC,
NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */
NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */
+ NFQA_CFG_QUEUE_MAXLEN, /* u_int32_t */
__NFQA_CFG_MAX
};
#define NFQA_CFG_MAX (__NFQA_CFG_MAX-1)
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
index 86a4ac3..936c86b 100644
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -939,6 +939,14 @@ nfqnl_recv_config(struct sock *ctnl, str
ntohl(params->copy_range));
}
+ if (nfqa[NFQA_CFG_QUEUE_MAXLEN-1]) {
+ u_int32_t *queue_maxlen;
+ queue_maxlen = NFA_DATA(nfqa[NFQA_CFG_QUEUE_MAXLEN-1]);
+ spin_lock_bh(&queue->lock);
+ queue->queue_maxlen = ntohl(*queue_maxlen);
+ spin_unlock_bh(&queue->lock);
+ }
+
out_put:
instance_put(queue);
return ret;
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2006-06-19 19:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-13 16:56 [PATCH 0/2] Specify nf_queue max length from userspace Eric Leblond
2006-06-13 17:06 ` [PATCH 1/2] " Eric Leblond
2006-06-16 12:36 ` Pablo Neira Ayuso
2006-06-17 21:24 ` Eric Leblond
2006-06-18 17:13 ` Pablo Neira Ayuso
2006-06-19 16:26 ` Patrick McHardy
2006-06-19 19:57 ` Eric Leblond [this message]
2006-06-20 1:21 ` Patrick McHardy
2006-06-19 20:01 ` [PATCH 2/2] " Eric Leblond
2006-06-13 17:07 ` [PATCH 2/2] [libnetfilter_queue] " Eric Leblond
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=1150747030.6979.6.camel@porky \
--to=eric@inl.fr \
--cc=kaber@trash.net \
--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.