Commit 0002c630 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller

ipv6: In fragmentation code, handle error returned from register_pernet_subsys.

The error code is ignored now, but ipv6 is a module and one can
be loaded under memory pressure, so the error may occur (in theory).

Besides, I'm going to handle error returned from registering a
read-only part of the table, so ignoring this one, while handing
the other one would look strange.

(However, this possibility of error is rather small, so I'm not 
 sure whether this is a candidate for current net tree).
Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0a64b4b8
...@@ -750,7 +750,9 @@ int __init ipv6_frag_init(void) ...@@ -750,7 +750,9 @@ int __init ipv6_frag_init(void)
if (ret) if (ret)
goto out; goto out;
register_pernet_subsys(&ip6_frags_ops); 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;
...@@ -763,6 +765,10 @@ int __init ipv6_frag_init(void) ...@@ -763,6 +765,10 @@ int __init ipv6_frag_init(void)
inet_frags_init(&ip6_frags); inet_frags_init(&ip6_frags);
out: out:
return ret; return ret;
err_pernet:
inet6_del_protocol(&frag_protocol, IPPROTO_FRAGMENT);
goto out;
} }
void ipv6_frag_exit(void) void ipv6_frag_exit(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment