From 5a565659fab964888b8564bbfcb2639915a3c4fa Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 2 Jul 2019 15:56:38 +0200 Subject: [PATCH] initrd: skip ethernet hwtype in BOOTIF Dracut documents the BOOTIF argument to be a MAC address and so we accept one in any of the conventions we recognize. However, the PXE boot loaders like to prepend a "01-" to denote an ethernet hardware type. Accept that too. https://bugzilla.redhat.com/show_bug.cgi?id=1726240 (cherry picked from commit 2952953a48f6834e2f6d4eaa81881842b3d6a00a) --- src/initrd/nmi-cmdline-reader.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/initrd/nmi-cmdline-reader.c b/src/initrd/nmi-cmdline-reader.c index 9eee4b0714..072610ec1b 100644 --- a/src/initrd/nmi-cmdline-reader.c +++ b/src/initrd/nmi-cmdline-reader.c @@ -742,6 +742,16 @@ nmi_cmdline_reader_parse (const char *sysfs_dir, char **argv) NMConnection *connection; NMSettingWired *s_wired; + if ( !nm_utils_hwaddr_valid (bootif, ETH_ALEN) + && g_str_has_prefix (bootif, "01-") + && nm_utils_hwaddr_valid (&bootif[3], ETH_ALEN)) { + /* + * BOOTIF MAC address can be prefixed with a hardware type identifier. + * "01" stays for "wired", no other are known. + */ + bootif += 3; + } + connection = get_conn (connections, NULL, NM_SETTING_WIRED_SETTING_NAME); s_wired = nm_connection_get_setting_wired (connection);