diff options
author | Eric Leblond <eric@inl.fr> | 2006-11-28 20:35:33 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:31:29 -0500 |
commit | 829e17a1a602572ffa3beefe582dc103ee9fb9c7 (patch) | |
tree | 6de236849437c207088f1ef744e77fdfe35b2d8a | |
parent | 7b621c1ea64a54f77b8a841b16dc4c9fee3ecf48 (diff) |
[NETFILTER]: nfnetlink_queue: allow changing queue length through netlink
Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Patrick McHardy <kaber@trash.net>
-rw-r--r-- | include/linux/netfilter/nfnetlink_queue.h | 1 | ||||
-rw-r--r-- | net/netfilter/nfnetlink_queue.c | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h index 4beea3d6fda8..83e789633e35 100644 --- a/include/linux/netfilter/nfnetlink_queue.h +++ b/include/linux/netfilter/nfnetlink_queue.h | |||
@@ -82,6 +82,7 @@ enum nfqnl_attr_config { | |||
82 | NFQA_CFG_UNSPEC, | 82 | NFQA_CFG_UNSPEC, |
83 | NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */ | 83 | NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */ |
84 | NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */ | 84 | NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */ |
85 | NFQA_CFG_QUEUE_MAXLEN, /* u_int32_t */ | ||
85 | __NFQA_CFG_MAX | 86 | __NFQA_CFG_MAX |
86 | }; | 87 | }; |
87 | #define NFQA_CFG_MAX (__NFQA_CFG_MAX-1) | 88 | #define NFQA_CFG_MAX (__NFQA_CFG_MAX-1) |
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index 82e4454659bf..a88a017da22c 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c | |||
@@ -947,6 +947,14 @@ nfqnl_recv_config(struct sock *ctnl, struct sk_buff *skb, | |||
947 | ntohl(params->copy_range)); | 947 | ntohl(params->copy_range)); |
948 | } | 948 | } |
949 | 949 | ||
950 | if (nfqa[NFQA_CFG_QUEUE_MAXLEN-1]) { | ||
951 | __be32 *queue_maxlen; | ||
952 | queue_maxlen = NFA_DATA(nfqa[NFQA_CFG_QUEUE_MAXLEN-1]); | ||
953 | spin_lock_bh(&queue->lock); | ||
954 | queue->queue_maxlen = ntohl(*queue_maxlen); | ||
955 | spin_unlock_bh(&queue->lock); | ||
956 | } | ||
957 | |||
950 | out_put: | 958 | out_put: |
951 | instance_put(queue); | 959 | instance_put(queue); |
952 | return ret; | 960 | return ret; |