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