diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2019-07-02 15:56:38 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2019-07-03 09:16:52 +0200 |
commit | 2952953a48f6834e2f6d4eaa81881842b3d6a00a (patch) | |
tree | 1f5d3ff9fd490a4c2a5d3504620bb8f3b5604126 | |
parent | add691a901c7bd93bcbef9ed81521f57126680a6 (diff) | |
download | NetworkManager-2952953a48f6834e2f6d4eaa81881842b3d6a00a.tar.gz |
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
-rw-r--r-- | src/initrd/nmi-cmdline-reader.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/initrd/nmi-cmdline-reader.c b/src/initrd/nmi-cmdline-reader.c index b79b43fe42..ccdd1f2992 100644 --- a/src/initrd/nmi-cmdline-reader.c +++ b/src/initrd/nmi-cmdline-reader.c @@ -745,6 +745,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); |