[CRIU] [PATCH 5/5] sockets: Don't exit with error if raw module unloaded
Cyrill Gorcunov
gorcunov at gmail.com
Thu Dec 20 11:08:41 MSK 2018
In regular checkpoint (not "check" action) current
architecture implies that basic diag modules such as
tcp/udp and etc will be loaded. In turn raw diag in
most case is either unloaded or even not compiled in
the system.
Thus for them just zap an error (but print this information
inside log). If an application does use raw sockets in real
we will fail later when being checkpointing the sockets
itselves.
Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
criu/sockets.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/criu/sockets.c b/criu/sockets.c
index 6601774a9513..30072ac73751 100644
--- a/criu/sockets.c
+++ b/criu/sockets.c
@@ -743,6 +743,18 @@ static int collect_err(int err, struct ns_id *ns, void *arg)
*/
if (err == -ENOENT) {
pr_debug("%s: %d\n", msg, err);
+ /*
+ * Unlike other modules RAW sockets are
+ * always optional and not commonly used.
+ * Currently we warn user about lack of
+ * a particular module support in "check"
+ * procedure. Thus don't fail on lack of
+ * RAW diags in a regular dump. If we meet
+ * a raw socket we will simply fail on dump
+ * procedure because it won't be resolved.
+ */
+ if (gr->protocol == IPPROTO_RAW)
+ return 0;
return -ENOENT;
}
--
2.17.2
More information about the CRIU
mailing list