cthelper: don't pass up a 0 length queue
PATCH 1/1 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 <[email protected]>
--- src/cthelper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
src/cthelper.c +3 -1
@@ -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" );
Signature · 1 line
1.9.1
Pablo Neira Ayuso
maintainerQuoted 3 lines · Chas Williams III
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.