Skip to content

Commit

Permalink
inet: frags: refactor lowpan_net_frag_init()
Browse files Browse the repository at this point in the history
We want to call lowpan_net_frag_init() earlier.
Similar to commit "inet: frags: refactor ipv6_frag_init()"

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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Apr 1, 2018
1 parent 5b975ba commit 807f184
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions net/ieee802154/6lowpan/reassembly.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,14 +615,6 @@ int __init lowpan_net_frag_init(void)
{
int ret;

ret = lowpan_frags_sysctl_register();
if (ret)
return ret;

ret = register_pernet_subsys(&lowpan_frags_ops);
if (ret)
goto err_pernet;

lowpan_frags.hashfn = lowpan_hashfn;
lowpan_frags.constructor = lowpan_frag_init;
lowpan_frags.destructor = NULL;
Expand All @@ -632,11 +624,21 @@ int __init lowpan_net_frag_init(void)
lowpan_frags.frags_cache_name = lowpan_frags_cache_name;
ret = inet_frags_init(&lowpan_frags);
if (ret)
goto err_pernet;
goto out;

ret = lowpan_frags_sysctl_register();
if (ret)
goto err_sysctl;

ret = register_pernet_subsys(&lowpan_frags_ops);
if (ret)
goto err_pernet;
out:
return ret;
err_pernet:
lowpan_frags_sysctl_unregister();
err_sysctl:
inet_frags_fini(&lowpan_frags);
return ret;
}

Expand Down

0 comments on commit 807f184

Please sign in to comment.