From 796f592eec3b83b61397f726a4e652a005cae3c2 Mon Sep 17 00:00:00 2001 From: Chas Williams III Date: Wed, 20 May 2015 07:50:50 -0600 Subject: 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 Signed-off-by: Pablo Neira Ayuso --- src/cthelper.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/cthelper.c') 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"); -- cgit v1.2.3