From patchwork Mon Feb 20 11:42:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 6560 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4PL0sM4yRKz3x1t for ; Mon, 20 Feb 2023 11:42:47 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4PL0sK4j7HzwL; Mon, 20 Feb 2023 11:42:45 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4PL0sK1GmSz2y9s; Mon, 20 Feb 2023 11:42:45 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4PL0sH4Dmrz2xNW for ; Mon, 20 Feb 2023 11:42:43 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4PL0sG4m8QzRR; Mon, 20 Feb 2023 11:42:42 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1676893362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=MLH1QHc76zLZrIyRqN1sVqq5/CpDKGioGtMhMD241RU=; b=V7Hshl7alNAzQQOsvELr3whXyvGw7nHlyOk26eOpCGllbNBGG2yDYVofKb82jjco0XS6+Q E8EUUbvPnnqKpSAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1676893362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=MLH1QHc76zLZrIyRqN1sVqq5/CpDKGioGtMhMD241RU=; b=QHq+DvEJilIe3E61IFDZI3a80WKgDwH4PdJdU4uM7IPNGk7u5vv3h/cYPHGLNnvIyVLjhM ycyXK3h8gNRkirP9iBE9aNk7wceQX/2hWbOCSYo9jBIzpIjCNiMjdznQmWRZlgie9d3D8y 5ZiFewSJfENaTfFAQYnIeRHH+5KZyHKfelxKhakQXheRa2X+4LnHzvha+FAuyCu6uL8Cua 0WOJDugyyD5/BArkLXgyIe+5J2BzA0p0FEQq7Xvv1qujp4wV4JS8OiGxPsgvkbXfMVWcRC gF6ITakOFBhD4DntDDHJr+f8wLT8FJueHQGP77pVI91U07yedLaqy4IfRS2zIg== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH] QMI: Disable raw_ip mode before assigning the new MAC. Date: Mon, 20 Feb 2023 12:42:35 +0100 Message-Id: <20230220114235.2228-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" To assign a MAC address, the device must not be in the raw_ip mode. Signed-off-by: Stefan Schantl --- src/initscripts/networking/functions.network | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/initscripts/networking/functions.network b/src/initscripts/networking/functions.network index 36541eb13..0e2e5009e 100644 --- a/src/initscripts/networking/functions.network +++ b/src/initscripts/networking/functions.network @@ -273,6 +273,10 @@ qmi_assign_address() { # Find the device local device="$(qmi_find_device "${intf}")" + # Switch off the raw_ip mode to be able to proper + # assign the generated MAC address. + echo "N" > "/sys/class/net/${intf}/qmi/raw_ip" + local address # Generate a "random" MAC address using the device number