From nobody Sat May 18 08:35:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1689266012; cv=none; d=zohomail.com; s=zohoarc; b=XNifogpoZDvc44l9TogGcQhDQWrcOLFlunQPhJo2/JLIir1zfVZEH2C4N65YT65TTAsDzR9RVOBp6SFLv2f8puVrbcbAzt+x+Lnd6NwQm6xItUDE1E2oOzdgkH9NCYx8kG1G6+NAff1fWqigoeFrQeP/xIaNg7EKyHRkQ6k4bcE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689266012; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=nG0AawkQDJU10geCONhoO+EcuTe4dMzVPDOCYSQHEuY=; b=K2jP49CDrLAr9Q/8y9X/jVXt1iICnatj+CnyAqs45mwnOytS2B8gX6Ij5k0pQGpwTDwMMfQIE74MtKjF3FhtNXsNQkdh+N49nrga4DPM2k/A6Mw/VUp2S0SZkgqy/vzyBEHN44pIH+IgBy+N2S6F7BuzjPZbW8vYNlfcYvhcnvU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1689266012886394.7184076477249; Thu, 13 Jul 2023 09:33:32 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-194-RT8ZiZDfMpWAKpzh6-D_1w-1; Thu, 13 Jul 2023 12:33:28 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6449E1044592; Thu, 13 Jul 2023 16:33:25 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B4A7C1ED96; Thu, 13 Jul 2023 16:33:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 342FB194658F; Thu, 13 Jul 2023 16:33:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A2EBA1946589 for ; Thu, 13 Jul 2023 16:33:00 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 77E602166B27; Thu, 13 Jul 2023 16:32:55 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.22.32.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 52E832166B26; Thu, 13 Jul 2023 16:32:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689266011; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=nG0AawkQDJU10geCONhoO+EcuTe4dMzVPDOCYSQHEuY=; b=FV9uQB9ZzeFHX6Jz7f5/nQ9fhJBuyTPr9iqZ9gIPhhTe0N+fIsIdKaTqpYiKli1J3W8Gk1 3cABf4wPaMobg+P4u4NmMH37PdBp4ErMiJwTeiNw7WoortVMfXcgrx7YIZU9JPlukRXUzj Mq0XPwtriiUqbISggatPn52KnrzqsEI= X-MC-Unique: RT8ZiZDfMpWAKpzh6-D_1w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH] qemu: don't add --mac-addr option to passt commandline Date: Thu, 13 Jul 2023 12:30:22 -0400 Message-ID: <20230713163255.1160501-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefano Brivio , Laszlo Ersek Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1689266013762100001 Content-Type: text/plain; charset="utf-8"; x-default="true" When I implemented passt support in libvirt, I saw the --mac-addr option on the passt commandline, immediately assumed that this was used for setting the guest interface's mac address somewhere within passt, and read no further. As a result, "--mac-addr" is always added to the passt commandline, specifying the setting from in the guest's interface config. But as pointed out in this bugzilla comment: https://bugzilla.redhat.com/2184967#c8 That is *not at all* what passt's --mac-addr option does. Instead, it is used to force the *remote* mac address for incoming traffic to a specific value. So setting --mac-addr results in all traffic on the interface having the same (the guest's) mac address for both source and destination in all traffic. Surprisingly, this still works, so nobody noticed it during testing. The proper thing is to not specify any mac address to passt - the remote MAC addresses can and should remain untouched, and the local MAC address will end up being known to passt and beyond just by the guest sending out packets with that MAC address. Reported-by: Laszlo Ersek Signed-off-by: Laine Stump Reviewed-by: Laszlo Ersek Reviewed-by: Stefano Brivio --- src/qemu/qemu_passt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/qemu/qemu_passt.c b/src/qemu/qemu_passt.c index 3679bf75fc..d36856e92e 100644 --- a/src/qemu/qemu_passt.c +++ b/src/qemu/qemu_passt.c @@ -176,7 +176,6 @@ qemuPasstStart(virDomainObj *vm, g_autofree char *passtSocketName =3D qemuPasstCreateSocketPath(vm, net= ); g_autoptr(virCommand) cmd =3D NULL; g_autofree char *pidfile =3D qemuPasstCreatePidFilename(vm, net); - char macaddr[VIR_MAC_STRING_BUFLEN]; bool needUnlink =3D false; size_t i; =20 @@ -187,7 +186,6 @@ qemuPasstStart(virDomainObj *vm, virCommandAddArgList(cmd, "--one-off", "--socket", passtSocketName, - "--mac-addr", virMacAddrFormat(&net->mac, macaddr= ), "--pid", pidfile, NULL); =20 --=20 2.41.0