public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Stefan Schantl <stefan.schantl@ipfire.org>
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	[thread overview]
Message-ID: <20230220114235.2228-1-stefan.schantl@ipfire.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 832 bytes --]

To assign a MAC address, the device must not be in
the raw_ip mode.

Signed-off-by: Stefan Schantl <stefan.schantl(a)ipfire.org>
---
 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
-- 
2.30.2


                 reply	other threads:[~2023-02-20 11:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230220114235.2228-1-stefan.schantl@ipfire.org \
    --to=stefan.schantl@ipfire.org \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox