All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Leblond <eric@inl.fr>
To: Patrick McHardy <kaber@trash.net>
Cc: robert <rbscott@cadvium.net>, netfilter-devel@lists.netfilter.org
Subject: [Patch 1/2] queue_maxlen
Date: Fri, 20 Oct 2006 18:40:21 +0200	[thread overview]
Message-ID: <1161362421.7529.1.camel@localhost.localdomain> (raw)
In-Reply-To: <45389F0E.6000000@trash.net>

[-- Attachment #1: Type: text/plain, Size: 862 bytes --]

Hi,

Here's the kernel patch for queue_maxlen settings.

BR,

Le vendredi 20 octobre 2006 à 12:03 +0200, Patrick McHardy a écrit :
> Eric Leblond wrote:
> > Hi,
> > 
> > Le mardi 17 octobre 2006 à 15:43 -0700, robert a écrit :
> > 
> >>Does NFQUEUE use the value in /proc/sys/net/ip_queue_maxlen?  If not,  
> >>is it possible to modify the maximum queue length for NFQUEUE?
> > 
> > 
> > Not with vanilla tree.
> > 
> > I've post a patch to enable it some times ago but It has not been
> > incorporated into main tree :
> > 
> > http://patchwork.netfilter.org/netfilter-devel/patch.pl?id=3628
> > http://patchwork.netfilter.org/netfilter-devel/patch.pl?id=3629
> > 
> > With that patch it is possible to do so on a per-queue basis by using
> > the new function nfq_set_queue_maxlen.
> 
> Please resend, I probably missed it.
> 
> 

[-- Attachment #2: specify-queue-max-length-from-userspace.patch --]
[-- Type: text/x-vhdl, Size: 1187 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;

  reply	other threads:[~2006-10-20 16:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-17 22:43 queue_maxlen robert
2006-10-17 22:54 ` queue_maxlen Eric Leblond
2006-10-20 10:03   ` queue_maxlen Patrick McHardy
2006-10-20 16:40     ` Eric Leblond [this message]
2006-10-23 22:39       ` [Patch 1/2] queue_maxlen Patrick McHardy
2006-10-20 16:41     ` [Patch 2/2] queue_maxlen 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=1161362421.7529.1.camel@localhost.localdomain \
    --to=eric@inl.fr \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=rbscott@cadvium.net \
    /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.