From: Stephane Bryant <stephane.ml.bryant@gmail.com>
To: pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org, stephane <stephane.ml.bryant@gmail.com>
Subject: [PATCH nf-next 1/3] netfilter: bridge: add nf_afinfo to enable queuing to userspace
Date: Fri, 15 Jan 2016 09:48:52 +0100 [thread overview]
Message-ID: <1452847734-3766-2-git-send-email-stephane.ml.bryant@gmail.com> (raw)
In-Reply-To: <1452847734-3766-1-git-send-email-stephane.ml.bryant@gmail.com>
From: stephane <stephane.ml.bryant@gmail.com>
This just adds and registers a nf_afinfo for the ethernet
bridge, which enables queuing to userspace for the AF_BRIDGE
family. No checksum computation is done.
Signed-off-by: Stephane Bryant <stephane.ml.bryant@gmail.com>
---
net/bridge/br_netfilter_hooks.c | 44 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c
index 7ddbe7e..7f8f922 100644
--- a/net/bridge/br_netfilter_hooks.c
+++ b/net/bridge/br_netfilter_hooks.c
@@ -999,6 +999,46 @@ static struct ctl_table brnf_table[] = {
};
#endif
+static void nf_br_saveroute(const struct sk_buff *skb,
+ struct nf_queue_entry *entry)
+{
+}
+
+static int nf_br_reroute(struct sk_buff *skb,
+ const struct nf_queue_entry *entry)
+{
+ return 0;
+}
+
+__sum16 nf_br_checksum(struct sk_buff *skb, unsigned int hook,
+ unsigned int dataoff, u_int8_t protocol)
+{
+ return 0;
+}
+
+static __sum16 nf_br_checksum_partial(struct sk_buff *skb, unsigned int hook,
+ unsigned int dataoff, unsigned int len,
+ u_int8_t protocol)
+{
+ return 0;
+}
+
+static int nf_br_route(struct net *net, struct dst_entry **dst,
+ struct flowi *fl, bool strict __always_unused)
+{
+ return 0;
+}
+
+static const struct nf_afinfo nf_br_afinfo = {
+ .family = AF_BRIDGE,
+ .checksum = nf_br_checksum,
+ .checksum_partial = nf_br_checksum_partial,
+ .route = nf_br_route,
+ .saveroute = nf_br_saveroute,
+ .reroute = nf_br_reroute,
+ .route_key_size = 0,
+};
+
static int __init br_netfilter_init(void)
{
int ret;
@@ -1018,12 +1058,16 @@ static int __init br_netfilter_init(void)
#endif
RCU_INIT_POINTER(nf_br_ops, &br_ops);
printk(KERN_NOTICE "Bridge firewalling registered\n");
+
+ nf_register_afinfo(&nf_br_afinfo);
+
return 0;
}
static void __exit br_netfilter_fini(void)
{
RCU_INIT_POINTER(nf_br_ops, NULL);
+ nf_unregister_afinfo(&nf_br_afinfo);
nf_unregister_hooks(br_nf_ops, ARRAY_SIZE(br_nf_ops));
#ifdef CONFIG_SYSCTL
unregister_net_sysctl_table(brnf_sysctl_header);
--
2.1.4
next prev parent reply other threads:[~2016-01-15 8:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-15 8:48 [PATCH nf-next 0/3] netfilter: bridge: add queuing to userspace for AF_BRIDGE family Stephane Bryant
2016-01-15 8:48 ` Stephane Bryant [this message]
2016-01-15 9:06 ` [PATCH nf-next 1/3] netfilter: bridge: add nf_afinfo to enable queuing to userspace kbuild test robot
2016-01-15 9:49 ` Florian Westphal
2016-01-20 14:34 ` stéphane bryant
2016-01-20 15:52 ` Florian Westphal
2016-01-15 8:48 ` [PATCH nf-next 2/3] netfilter: bridge: pull back mac header into skb queued " Stephane Bryant
2016-01-15 8:48 ` [PATCH nf-next 3/3] netfilter: bridge: copy back VLAN header for bridge packet " Stephane Bryant
2016-01-15 10:06 ` Florian Westphal
2016-01-15 10:49 ` Florian Westphal
2016-01-15 11:02 ` Pablo Neira Ayuso
2016-01-15 14:04 ` Florian Westphal
2016-01-15 16:33 ` Pablo Neira Ayuso
2016-01-16 11:00 ` stéphane bryant
2016-01-16 11:06 ` Florian Westphal
2016-01-23 9:30 ` stéphane bryant
2016-01-23 20:39 ` Florian Westphal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1452847734-3766-2-git-send-email-stephane.ml.bryant@gmail.com \
--to=stephane.ml.bryant@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).