From nobody Tue Feb 10 05:25:59 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1544063745639467.45767380684606; Wed, 5 Dec 2018 18:35:45 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 894A1369D3; Thu, 6 Dec 2018 02:35:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 57F4F648BA; Thu, 6 Dec 2018 02:35:43 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 117E03F774; Thu, 6 Dec 2018 02:35:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wB62ZM49026828 for ; Wed, 5 Dec 2018 21:35:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 45C3D18823; Thu, 6 Dec 2018 02:35:22 +0000 (UTC) Received: from vhost2.laine.org (ovpn-117-189.phx2.redhat.com [10.3.117.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9057B6109E; Thu, 6 Dec 2018 02:35:21 +0000 (UTC) From: Laine Stump To: libvir-list@redhat.com, kolomaxes@gmail.com Date: Wed, 5 Dec 2018 21:35:13 -0500 Message-Id: <20181206023513.2912-3-laine@laine.org> In-Reply-To: <20181206023513.2912-1-laine@laine.org> References: <20181206023513.2912-1-laine@laine.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] lxc: check actual type of interface not config type X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 06 Dec 2018 02:35:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" virLXCControllerGetNICIndexes() was deciding whether or not to add the ifindex for an interface's ifname to the list of ifindexes sent to CreateMachineWithNetwork based on the interface type stored in the config. This would be incorrect in the case of where the network was giving out macvlan interfaces tied to a physical device (i.e. when the actual interface type was "direct"). Instead of checking the setting of "net->type", we should be checking the setting of virDomainNetGetActualType(net). I don't think this caused any actual misbehavior, it was just technically wrong. Signed-off-by: Laine Stump Reviewed-by: Daniel P. Berrang=C3=A9 --- src/lxc/lxc_controller.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 1c20f451af..dad6abed3b 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -377,7 +377,8 @@ static int virLXCControllerGetNICIndexes(virLXCControll= erPtr ctrl) VIR_DEBUG("Getting nic indexes"); for (i =3D 0; i < ctrl->def->nnets; i++) { int nicindex =3D -1; - switch (ctrl->def->nets[i]->type) { + + switch (virDomainNetGetActualType(ctrl->def->nets[i])) { case VIR_DOMAIN_NET_TYPE_BRIDGE: case VIR_DOMAIN_NET_TYPE_NETWORK: case VIR_DOMAIN_NET_TYPE_ETHERNET: --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list