* [PATCH] cthelper: don't pass up a 0 length queue
@ 2015-05-20 13:50 Chas Williams III
2015-05-21 13:18 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Chas Williams III @ 2015-05-20 13:50 UTC (permalink / raw)
To: netfilter-devel@vger.kernel.org
If the user didn't specify a queue length in the configuration file it
will have a length of 0. Allow the kernel's default to take precedence
instead.
Signed-off-by: Charles (Chas) Williams <ciwillia@brocade.com>
---
src/cthelper.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/cthelper.c b/src/cthelper.c
index fec40fb..6ba731b 100644
--- a/src/cthelper.c
+++ b/src/cthelper.c
@@ -469,7 +469,9 @@ static int cthelper_nfqueue_setup(struct ctd_helper_instance *cur)
nfq_nlmsg_cfg_put_params(nlh, NFQNL_COPY_PACKET, 0xffff);
mnl_attr_put_u32(nlh, NFQA_CFG_FLAGS, htonl(NFQA_CFG_F_CONNTRACK));
mnl_attr_put_u32(nlh, NFQA_CFG_MASK, htonl(0xffffffff));
- mnl_attr_put_u32(nlh, NFQA_CFG_QUEUE_MAXLEN, htonl(cur->queue_len));
+ if (cur->queue_len > 0) {
+ mnl_attr_put_u32(nlh, NFQA_CFG_QUEUE_MAXLEN, htonl(cur->queue_len));
+ }
if (mnl_socket_sendto(STATE_CTH(nl), nlh, nlh->nlmsg_len) < 0) {
dlog(LOG_ERR, "failed to send configuration");
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cthelper: don't pass up a 0 length queue
2015-05-20 13:50 [PATCH] cthelper: don't pass up a 0 length queue Chas Williams III
@ 2015-05-21 13:18 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2015-05-21 13:18 UTC (permalink / raw)
To: Chas Williams III; +Cc: netfilter-devel@vger.kernel.org
On Wed, May 20, 2015 at 07:50:50AM -0600, Chas Williams III wrote:
> If the user didn't specify a queue length in the configuration file it
> will have a length of 0. Allow the kernel's default to take precedence
> instead.
Thanks for addressing this. Applied.
BTW, I broke line at 80 chars. We stick to Linux kernel coding style
in userspace as much as possible, no problem just for the next time.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-21 13:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-20 13:50 [PATCH] cthelper: don't pass up a 0 length queue Chas Williams III
2015-05-21 13:18 ` Pablo Neira Ayuso
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).