From c1fd648dd85fd254e31bb8d3503cb6b7009cfcfc Mon Sep 17 00:00:00 2001 From: Tycho Andersen Date: Fri, 6 Nov 2015 12:58:02 -0700 Subject: [PATCH] c/r: don't require a veth link to c/r MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit veths can be unconnected in the container's config, and we should handle this case. Signed-off-by: Tycho Andersen Acked-by: Stéphane Graber --- src/lxc/criu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lxc/criu.c b/src/lxc/criu.c index 798036a95..7ee6cbea2 100644 --- a/src/lxc/criu.c +++ b/src/lxc/criu.c @@ -178,7 +178,10 @@ void exec_criu(struct criu_opts *opts) veth = n->priv.veth_attr.pair; - ret = snprintf(buf, sizeof(buf), "%s=%s@%s", eth, veth, n->link); + if (n->link) + ret = snprintf(buf, sizeof(buf), "%s=%s@%s", eth, veth, n->link); + else + ret = snprintf(buf, sizeof(buf), "%s=%s", eth, veth); if (ret < 0 || ret >= sizeof(buf)) goto err; -- 2.47.2