summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChas Williams III <Charles.Williams@brocade.com>2015-05-20 07:50:50 -0600
committerPablo Neira Ayuso <pablo@netfilter.org>2015-05-21 15:14:45 +0200
commit796f592eec3b83b61397f726a4e652a005cae3c2 (patch)
treea8a5324fdccbc91c7432262b8ea26e6eb180986e
parent28171b61622390f241101cbc4573c443ef9935aa (diff)
downloadconntrack-tools-796f592eec3b83b61397f726a4e652a005cae3c2.tar.gz
conntrack-tools-796f592eec3b83b61397f726a4e652a005cae3c2.zip
cthelper: don't pass up a 0 length queue
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> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--src/cthelper.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cthelper.c b/src/cthelper.c
index bd8b8b7..15d5126 100644
--- a/src/cthelper.c
+++ b/src/cthelper.c
@@ -470,7 +470,10 @@ 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");