From: Tom Herbert <tom@herbertland.com>
To: <davem@davemloft.net>, <agartrell@fb.com>, <maheshb@google.com>,
<tgraf@suug.ch>, <netdev@vger.kernel.org>
Subject: [RFC net-next 4/6] net: ILA use special route hook
Date: Wed, 3 Jun 2015 12:58:20 -0700 [thread overview]
Message-ID: <1433361502-3478761-5-git-send-email-tom@herbertland.com> (raw)
In-Reply-To: <1433361502-3478761-1-git-send-email-tom@herbertland.com>
Register hooks from ILA.
Signed-off-by: Tom Herbert <tom@herbertland.com>
---
net/ipv6/ila.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/net/ipv6/ila.c b/net/ipv6/ila.c
index 54a215d..d6fce77 100644
--- a/net/ipv6/ila.c
+++ b/net/ipv6/ila.c
@@ -11,11 +11,16 @@
#include <net/genetlink.h>
#include <net/ila.h>
#include <net/ip.h>
+#include <net/ip6_route.h>
#include <net/netns/generic.h>
#include <net/protocol.h>
#include <uapi/linux/genetlink.h>
#include <uapi/linux/ila.h>
+static bool special_route;
+module_param(special_route, bool, 0644);
+MODULE_PARM_DESC(special_route, "Set up special route hook");
+
struct ila_map {
u64 identifier;
u64 locator;
@@ -370,12 +375,19 @@ static struct pernet_operations ila_net_ops = {
.size = sizeof(struct ila_net),
};
+struct special_route ila_route_special = {
+ .input = ila_xlat_incoming,
+ .output = ila_xlat_outgoing,
+};
+
static int __init ila_init(void)
{
int ret;
ila_init_secret();
+ ip6_route_special_add(&ila_route_special);
+
ret = register_pernet_device(&ila_net_ops);
if (ret)
goto exit;
@@ -444,6 +456,7 @@ static void nat_locator(struct sk_buff *skb, struct ipv6hdr *ip6h, u64 locator)
static void __exit ila_fini(void)
{
+ ip6_route_special_remove(&ila_route_special);
genl_unregister_family(&ila_nl_family);
unregister_pernet_device(&ila_net_ops);
}
--
1.8.1
next prev parent reply other threads:[~2015-06-03 19:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-03 19:58 [RFC net-next 0/6] net: Identifier Locator Addressing Tom Herbert
2015-06-03 19:58 ` [RFC net-next 1/6] net: Checksum functions to replace 8 bytes at a time Tom Herbert
2015-06-03 19:58 ` [RFC net-next 2/6] net: Identfier Locator Addressing module Tom Herbert
2015-06-04 8:58 ` Thomas Graf
2015-06-04 10:02 ` Hannes Frederic Sowa
2015-06-03 19:58 ` [RFC net-next 3/6] net: Special routing hook Tom Herbert
2015-06-04 7:40 ` Hannes Frederic Sowa
2015-06-03 19:58 ` Tom Herbert [this message]
2015-06-03 19:58 ` [RFC net-next 5/6] net: ILA iptables target Tom Herbert
2015-06-03 19:58 ` [RFC net-next 6/6] ipvlan: Call ILA in incoming and outgoing receive paths Tom Herbert
2015-06-04 8:58 ` Thomas Graf
2015-06-04 9:00 ` [RFC net-next 0/6] net: Identifier Locator Addressing Thomas Graf
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=1433361502-3478761-5-git-send-email-tom@herbertland.com \
--to=tom@herbertland.com \
--cc=agartrell@fb.com \
--cc=davem@davemloft.net \
--cc=maheshb@google.com \
--cc=netdev@vger.kernel.org \
--cc=tgraf@suug.ch \
/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).