summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2019-03-29 21:16:22 +0100
committerSteffen Klassert <steffen.klassert@secunet.com>2019-04-08 09:13:46 +0200
commitb262a69582a4676c7378a73077b7bb186c7c5b2a (patch)
tree5c71243107e5f14023de503aeb2acd2214f01d25 /net/ipv6
parentf981c57ffd2d7cf2dd4b6d6f8fcb3965df42f54c (diff)
downloadlinux-b262a69582a4676c7378a73077b7bb186c7c5b2a.tar.gz
linux-b262a69582a4676c7378a73077b7bb186c7c5b2a.tar.bz2
linux-b262a69582a4676c7378a73077b7bb186c7c5b2a.zip
xfrm: place af number into xfrm_mode struct
This will be useful to know if we're supposed to decode ipv4 or ipv6. While at it, make the unregister function return void, all module_exit functions did just BUG(); there is never a point in doing error checks if there is no way to handle such error. Signed-off-by: Florian Westphal <fw@strlen.de> Reviewed-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/xfrm6_mode_beet.c8
-rw-r--r--net/ipv6/xfrm6_mode_ro.c8
-rw-r--r--net/ipv6/xfrm6_mode_transport.c8
-rw-r--r--net/ipv6/xfrm6_mode_tunnel.c8
4 files changed, 12 insertions, 20 deletions
diff --git a/net/ipv6/xfrm6_mode_beet.c b/net/ipv6/xfrm6_mode_beet.c
index 57fd314ec2b8..0d440e3a13f8 100644
--- a/net/ipv6/xfrm6_mode_beet.c
+++ b/net/ipv6/xfrm6_mode_beet.c
@@ -110,19 +110,17 @@ static struct xfrm_mode xfrm6_beet_mode = {
.owner = THIS_MODULE,
.encap = XFRM_MODE_BEET,
.flags = XFRM_MODE_FLAG_TUNNEL,
+ .family = AF_INET6,
};
static int __init xfrm6_beet_init(void)
{
- return xfrm_register_mode(&xfrm6_beet_mode, AF_INET6);
+ return xfrm_register_mode(&xfrm6_beet_mode);
}
static void __exit xfrm6_beet_exit(void)
{
- int err;
-
- err = xfrm_unregister_mode(&xfrm6_beet_mode, AF_INET6);
- BUG_ON(err);
+ xfrm_unregister_mode(&xfrm6_beet_mode);
}
module_init(xfrm6_beet_init);
diff --git a/net/ipv6/xfrm6_mode_ro.c b/net/ipv6/xfrm6_mode_ro.c
index da28e4407b8f..0408547d01ab 100644
--- a/net/ipv6/xfrm6_mode_ro.c
+++ b/net/ipv6/xfrm6_mode_ro.c
@@ -64,19 +64,17 @@ static struct xfrm_mode xfrm6_ro_mode = {
.output = xfrm6_ro_output,
.owner = THIS_MODULE,
.encap = XFRM_MODE_ROUTEOPTIMIZATION,
+ .family = AF_INET6,
};
static int __init xfrm6_ro_init(void)
{
- return xfrm_register_mode(&xfrm6_ro_mode, AF_INET6);
+ return xfrm_register_mode(&xfrm6_ro_mode);
}
static void __exit xfrm6_ro_exit(void)
{
- int err;
-
- err = xfrm_unregister_mode(&xfrm6_ro_mode, AF_INET6);
- BUG_ON(err);
+ xfrm_unregister_mode(&xfrm6_ro_mode);
}
module_init(xfrm6_ro_init);
diff --git a/net/ipv6/xfrm6_mode_transport.c b/net/ipv6/xfrm6_mode_transport.c
index 3c29da5defe6..66ae79218bdf 100644
--- a/net/ipv6/xfrm6_mode_transport.c
+++ b/net/ipv6/xfrm6_mode_transport.c
@@ -100,19 +100,17 @@ static struct xfrm_mode xfrm6_transport_mode = {
.xmit = xfrm6_transport_xmit,
.owner = THIS_MODULE,
.encap = XFRM_MODE_TRANSPORT,
+ .family = AF_INET6,
};
static int __init xfrm6_transport_init(void)
{
- return xfrm_register_mode(&xfrm6_transport_mode, AF_INET6);
+ return xfrm_register_mode(&xfrm6_transport_mode);
}
static void __exit xfrm6_transport_exit(void)
{
- int err;
-
- err = xfrm_unregister_mode(&xfrm6_transport_mode, AF_INET6);
- BUG_ON(err);
+ xfrm_unregister_mode(&xfrm6_transport_mode);
}
module_init(xfrm6_transport_init);
diff --git a/net/ipv6/xfrm6_mode_tunnel.c b/net/ipv6/xfrm6_mode_tunnel.c
index de1b0b8c53b0..6cf12e961ea5 100644
--- a/net/ipv6/xfrm6_mode_tunnel.c
+++ b/net/ipv6/xfrm6_mode_tunnel.c
@@ -130,19 +130,17 @@ static struct xfrm_mode xfrm6_tunnel_mode = {
.owner = THIS_MODULE,
.encap = XFRM_MODE_TUNNEL,
.flags = XFRM_MODE_FLAG_TUNNEL,
+ .family = AF_INET6,
};
static int __init xfrm6_mode_tunnel_init(void)
{
- return xfrm_register_mode(&xfrm6_tunnel_mode, AF_INET6);
+ return xfrm_register_mode(&xfrm6_tunnel_mode);
}
static void __exit xfrm6_mode_tunnel_exit(void)
{
- int err;
-
- err = xfrm_unregister_mode(&xfrm6_tunnel_mode, AF_INET6);
- BUG_ON(err);
+ xfrm_unregister_mode(&xfrm6_tunnel_mode);
}
module_init(xfrm6_mode_tunnel_init);