[Pkg-libvirt-commits] [libvirt] 06/10: lxc: Fix crash when using interface type 'direct'

Guido Guenther agx at moszumanska.debian.org
Wed Dec 24 10:14:42 UTC 2014


This is an automated email from the git hooks/post-receive script.

agx pushed a commit to annotated tag debian/1.2.9-7
in repository libvirt.

commit 87b37135efd9a49cb9b01c742924a15a5c55b36d
Author: Guido Günther <agx at sigxcpu.org>
Date:   Wed Dec 24 09:50:40 2014 +0100

    lxc: Fix crash when using interface type 'direct'
    
    Thanks: Bastian Blank for the patch
    Closes: #769600
---
 ...c-Don-t-crash-on-NULL-ifname_guest_actual.patch | 21 ++++++++++++++
 ...tting-ifname_guest_actual-to-virLXCSetupI.patch | 32 ++++++++++++++++++++++
 debian/patches/series                              |  2 ++
 3 files changed, 55 insertions(+)

diff --git a/debian/patches/lxc-Don-t-crash-on-NULL-ifname_guest_actual.patch b/debian/patches/lxc-Don-t-crash-on-NULL-ifname_guest_actual.patch
new file mode 100644
index 0000000..9222bf8
--- /dev/null
+++ b/debian/patches/lxc-Don-t-crash-on-NULL-ifname_guest_actual.patch
@@ -0,0 +1,21 @@
+From: =?utf-8?q?Guido_G=C3=BCnther?= <agx at sigxcpu.org>
+Date: Fri, 19 Dec 2014 10:11:42 +0100
+Subject: lxc: Don't crash on NULL ifname_guest_actual
+
+---
+ src/lxc/lxc_container.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index 2af2674..0ebcb11 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -473,7 +473,7 @@ lxcContainerGetNetDef(virDomainDefPtr vmDef, const char *devName)
+ 
+     for (i = 0; i < vmDef->nnets; i++) {
+         netDef = vmDef->nets[i];
+-        if (STREQ(netDef->ifname_guest_actual, devName))
++        if (netDef->ifname_guest_actual && STREQ(netDef->ifname_guest_actual, devName))
+             return netDef;
+     }
+ 
diff --git a/debian/patches/lxc-Move-setting-ifname_guest_actual-to-virLXCSetupI.patch b/debian/patches/lxc-Move-setting-ifname_guest_actual-to-virLXCSetupI.patch
new file mode 100644
index 0000000..772a1cc
--- /dev/null
+++ b/debian/patches/lxc-Move-setting-ifname_guest_actual-to-virLXCSetupI.patch
@@ -0,0 +1,32 @@
+From: =?utf-8?q?Guido_G=C3=BCnther?= <agx at sigxcpu.org>
+Date: Fri, 19 Dec 2014 10:08:38 +0100
+Subject: lxc: Move setting ifname_guest_actual to virLXCSetupInterfaces
+
+so it applies to interfaces of type 'direct' too.
+---
+ src/lxc/lxc_process.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
+index ed30c37..d15c215 100644
+--- a/src/lxc/lxc_process.c
++++ b/src/lxc/lxc_process.c
+@@ -259,8 +259,6 @@ char *virLXCProcessSetupInterfaceBridged(virConnectPtr conn,
+ 
+     if (virNetDevSetMAC(containerVeth, &net->mac) < 0)
+         goto cleanup;
+-    if (VIR_STRDUP(net->ifname_guest_actual, containerVeth) < 0)
+-        goto cleanup;
+ 
+     if (vport && vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH) {
+         if (virNetDevOpenvswitchAddPort(brname, parentVeth, &net->mac,
+@@ -452,6 +450,9 @@ static int virLXCProcessSetupInterfaces(virConnectPtr conn,
+ 
+         (*veths)[(*nveths)-1] = veth;
+ 
++        if (VIR_STRDUP(def->nets[i]->ifname_guest_actual, veth) < 0)
++            goto cleanup;
++
+         /* Make sure all net definitions will have a name in the container */
+         if (!def->nets[i]->ifname_guest) {
+             if (virAsprintf(&def->nets[i]->ifname_guest, "eth%zu", niface) < 0)
diff --git a/debian/patches/series b/debian/patches/series
index aedd174..024df0d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -21,3 +21,5 @@ qemu-bulk-stats-Fix-logic-in-monitor-handling.patch
 security/CVE-2014-8135-storage-fix-crash-caused-by-no-check-r.patch
 security/CVE-2014-8136-qemu-migration-Unlock-vm-on-failed-ACL.patch
 upstream/qemu-Fix-crash-in-tunnelled-migration.patch
+lxc-Move-setting-ifname_guest_actual-to-virLXCSetupI.patch
+lxc-Don-t-crash-on-NULL-ifname_guest_actual.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libvirt.git



More information about the Pkg-libvirt-commits mailing list