[NETFILTER]: nfnetlink_queue: allow changing queue length through netlink
authorEric Leblond <eric@inl.fr>
Wed, 29 Nov 2006 01:35:33 +0000 (02:35 +0100)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 3 Dec 2006 05:31:29 +0000 (21:31 -0800)
Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Patrick McHardy <kaber@trash.net>
include/linux/netfilter/nfnetlink_queue.h
net/netfilter/nfnetlink_queue.c

index 4beea3d6fda8492af67765e58de97e6087b2a093..83e789633e353c4b42e48e0aa2b7b4c444b6aea0 100644 (file)
@@ -82,6 +82,7 @@ enum nfqnl_attr_config {
        NFQA_CFG_UNSPEC,
        NFQA_CFG_CMD,                   /* nfqnl_msg_config_cmd */
        NFQA_CFG_PARAMS,                /* nfqnl_msg_config_params */
+       NFQA_CFG_QUEUE_MAXLEN,          /* u_int32_t */
        __NFQA_CFG_MAX
 };
 #define NFQA_CFG_MAX (__NFQA_CFG_MAX-1)
index 82e4454659bfb96dd794ea22c47092ebf5a2532a..a88a017da22c4146893952a6d0706fa9e44aebe3 100644 (file)
@@ -947,6 +947,14 @@ nfqnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
                                ntohl(params->copy_range));
        }
 
+       if (nfqa[NFQA_CFG_QUEUE_MAXLEN-1]) {
+               __be32 *queue_maxlen;
+               queue_maxlen = NFA_DATA(nfqa[NFQA_CFG_QUEUE_MAXLEN-1]);
+               spin_lock_bh(&queue->lock);
+               queue->queue_maxlen = ntohl(*queue_maxlen);
+               spin_unlock_bh(&queue->lock);
+       }
+
 out_put:
        instance_put(queue);
        return ret;