From: Pavel Emelyanov <xemul@openvz.org>
To: David Miller <davem@davemloft.net>
Cc: Linux Netdev List <netdev@vger.kernel.org>
Subject: [PATCH net-next 4/6][IP6FRAGS]: Handle error, returned from register_pernet_subsys.
Date: Mon, 19 May 2008 20:02:25 +0400 [thread overview]
Message-ID: <4831A491.2020009@openvz.org> (raw)
In-Reply-To: <4831A1D6.4090503@openvz.org>
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: Pavel Emelyanov <xemul@openvz.org>
---
net/ipv6/reassembly.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 7e008de..130d6f6 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -750,7 +750,9 @@ int __init ipv6_frag_init(void)
if (ret)
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.constructor = ip6_frag_init;
@@ -763,6 +765,10 @@ int __init ipv6_frag_init(void)
inet_frags_init(&ip6_frags);
out:
return ret;
+
+err_pernet:
+ inet6_del_protocol(&frag_protocol, IPPROTO_FRAGMENT);
+ goto out;
}
void ipv6_frag_exit(void)
--
1.5.3.4
next prev parent reply other threads:[~2008-05-19 16:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-19 15:50 [PATCH net-next 0/6][NETNS]: Revisit read-only-in-namespaces sysctls Pavel Emelyanov
2008-05-19 15:52 ` [PATCH net-next 1/6][NETNS]: Introduce sysctl root for read-only net sysctls Pavel Emelyanov
2008-05-19 20:53 ` David Miller
2008-05-19 15:55 ` [PATCH net-next 2/6][NETNS]: Register net/core/ sysctls at read-only root Pavel Emelyanov
2008-05-19 20:53 ` David Miller
2008-05-19 15:58 ` [PATCH net-next 3/6][FRAGS]: Rename sysctl-related functions/variables Pavel Emelyanov
2008-05-19 20:53 ` David Miller
2008-05-19 16:02 ` Pavel Emelyanov [this message]
2008-05-19 20:54 ` [PATCH net-next 4/6][IP6FRAGS]: Handle error, returned from register_pernet_subsys David Miller
2008-05-19 16:04 ` [PATCH net-next 5/6][FRAGS]: Register some ctls at read-only root Pavel Emelyanov
2008-05-19 20:54 ` David Miller
2008-05-19 16:06 ` [PATCH net-next 6/6][IPV6]: Register some net/ipv6/ core sysctls " Pavel Emelyanov
2008-05-19 20:54 ` David Miller
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=4831A491.2020009@openvz.org \
--to=xemul@openvz.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/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).