aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/nfnetlink_queue.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@netfilter.org>2005-08-09 20:23:11 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 15:51:18 -0700
commitbbd86b9fc469b7e91dc7444e6abb8930811d79cb (patch)
tree0d1133f5f499cab639784407f53938ba5060807f /net/netfilter/nfnetlink_queue.c
parent[NETFILTER]: add correct bridging support to nfnetlink_{queue,log} (diff)
downloadlinux-dev-bbd86b9fc469b7e91dc7444e6abb8930811d79cb.tar.xz
linux-dev-bbd86b9fc469b7e91dc7444e6abb8930811d79cb.zip
[NETFILTER]: add /proc/net/netfilter interface to nf_queue
This patch adds a /proc/net/netfilter/nf_queue file, similar to the recently-added /proc/net/netfilter/nf_log. It indicates which queue handler is registered to which protocol family. This is useful since there are now multiple queue handlers in the treee (ip[6]_queue, nfnetlink_queue). Signed-off-by: Harald Welte <laforge@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter/nfnetlink_queue.c')
-rw-r--r--net/netfilter/nfnetlink_queue.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
index bf9223084b4a..741686ff71d8 100644
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -845,6 +845,11 @@ static const int nfqa_cfg_min[NFQA_CFG_MAX] = {
[NFQA_CFG_PARAMS-1] = sizeof(struct nfqnl_msg_config_params),
};
+static struct nf_queue_handler nfqh = {
+ .name = "nf_queue",
+ .outfn = &nfqnl_enqueue_packet,
+};
+
static int
nfqnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
struct nlmsghdr *nlh, struct nfattr *nfqa[], int *errp)
@@ -890,10 +895,7 @@ nfqnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
case NFQNL_CFG_CMD_PF_BIND:
QDEBUG("registering queue handler for pf=%u\n",
ntohs(cmd->pf));
- ret = nf_register_queue_handler(ntohs(cmd->pf),
- nfqnl_enqueue_packet,
- NULL);
-
+ ret = nf_register_queue_handler(ntohs(cmd->pf), &nfqh);
break;
case NFQNL_CFG_CMD_PF_UNBIND:
QDEBUG("unregistering queue handler for pf=%u\n",
@@ -1098,7 +1100,7 @@ init_or_cleanup(int init)
return status;
cleanup:
- nf_unregister_queue_handlers(nfqnl_enqueue_packet);
+ nf_unregister_queue_handlers(&nfqh);
unregister_netdevice_notifier(&nfqnl_dev_notifier);
#ifdef CONFIG_PROC_FS
remove_proc_entry("nfnetlink_queue", proc_net_netfilter);