mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
inet: frags: refactor ipv6_frag_init()
We want to call inet_frags_init() earlier.
This is a prereq to "inet: frags: use rhashtables for reassembly units"
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5b975bab23)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
bbf6d86044
commit
dae73e7d73
@@ -740,18 +740,6 @@ int __init ipv6_frag_init(void)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = inet6_add_protocol(&frag_protocol, IPPROTO_FRAGMENT);
|
|
||||||
if (ret)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
ret = ip6_frags_sysctl_register();
|
|
||||||
if (ret)
|
|
||||||
goto err_sysctl;
|
|
||||||
|
|
||||||
ret = register_pernet_subsys(&ip6_frags_ops);
|
|
||||||
if (ret)
|
|
||||||
goto err_pernet;
|
|
||||||
|
|
||||||
ip6_frags.hashfn = ip6_hashfn;
|
ip6_frags.hashfn = ip6_hashfn;
|
||||||
ip6_frags.constructor = ip6_frag_init;
|
ip6_frags.constructor = ip6_frag_init;
|
||||||
ip6_frags.destructor = NULL;
|
ip6_frags.destructor = NULL;
|
||||||
@@ -760,8 +748,21 @@ int __init ipv6_frag_init(void)
|
|||||||
ip6_frags.frag_expire = ip6_frag_expire;
|
ip6_frags.frag_expire = ip6_frag_expire;
|
||||||
ip6_frags.frags_cache_name = ip6_frag_cache_name;
|
ip6_frags.frags_cache_name = ip6_frag_cache_name;
|
||||||
ret = inet_frags_init(&ip6_frags);
|
ret = inet_frags_init(&ip6_frags);
|
||||||
|
if (ret)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
ret = inet6_add_protocol(&frag_protocol, IPPROTO_FRAGMENT);
|
||||||
|
if (ret)
|
||||||
|
goto err_protocol;
|
||||||
|
|
||||||
|
ret = ip6_frags_sysctl_register();
|
||||||
|
if (ret)
|
||||||
|
goto err_sysctl;
|
||||||
|
|
||||||
|
ret = register_pernet_subsys(&ip6_frags_ops);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_pernet;
|
goto err_pernet;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@@ -769,6 +770,8 @@ err_pernet:
|
|||||||
ip6_frags_sysctl_unregister();
|
ip6_frags_sysctl_unregister();
|
||||||
err_sysctl:
|
err_sysctl:
|
||||||
inet6_del_protocol(&frag_protocol, IPPROTO_FRAGMENT);
|
inet6_del_protocol(&frag_protocol, IPPROTO_FRAGMENT);
|
||||||
|
err_protocol:
|
||||||
|
inet_frags_fini(&ip6_frags);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user