[PATCH] cthelper: don't pass up a 0 length queue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 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



��.n��������+%������w��{.n����z��׫���n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�


[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux