[lxc-devel] [PATCH] c/r: don't require a veth link to c/r

Tycho Andersen tycho.andersen at canonical.com
Fri Nov 6 19:58:02 UTC 2015


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

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
 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 798036a..7ee6cbe 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.6.2



More information about the lxc-devel mailing list