]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
c/r: don't require a veth link to c/r
authorTycho Andersen <tycho.andersen@canonical.com>
Fri, 6 Nov 2015 19:58:02 +0000 (12:58 -0700)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 6 Nov 2015 20:02:36 +0000 (15:02 -0500)
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>
src/lxc/criu.c

index 798036a95f8f0c7ec41ee730651ebd8255b0695d..7ee6cbea2ca9f4fa22e7f851dca62b97113706b8 100644 (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;