Skip to content

Commit 829e17a

Browse files
regitDavid S. Miller
authored andcommitted
[NETFILTER]: nfnetlink_queue: allow changing queue length through netlink
Signed-off-by: Eric Leblond <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
1 parent 7b621c1 commit 829e17a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

include/linux/netfilter/nfnetlink_queue.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ enum nfqnl_attr_config {
8282
NFQA_CFG_UNSPEC,
8383
NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */
8484
NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */
85+
NFQA_CFG_QUEUE_MAXLEN, /* u_int32_t */
8586
__NFQA_CFG_MAX
8687
};
8788
#define NFQA_CFG_MAX (__NFQA_CFG_MAX-1)

net/netfilter/nfnetlink_queue.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,14 @@ nfqnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
947947
ntohl(params->copy_range));
948948
}
949949

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+
950958
out_put:
951959
instance_put(queue);
952960
return ret;

0 commit comments

Comments
 (0)