c/r: don't require a veth link to c/r

veths can be unconnected in the container's config, and we should handle
this case.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
Tycho Andersen 2015-11-06 12:58:02 -07:00 committed by Stéphane Graber
parent 93525c00c7
commit c1fd648dd8

View File

@ -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;