mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 20:20:09 +01:00
initrd: handle rd.znet with legacy interface names
Handle rd.znet with legacy interface names too, the index for eth or ctc corresponds to the position on the command line.
This commit is contained in:
parent
c7423dca89
commit
22e388d90e
1 changed files with 17 additions and 2 deletions
|
|
@ -692,16 +692,29 @@ parse_rd_znet (GHashTable *connections, char *argument, gboolean net_ifnames)
|
|||
const char *prefix;
|
||||
NMConnection *connection;
|
||||
NMSettingWired *s_wired;
|
||||
static int count_ctc = 0;
|
||||
static int count_eth = 0;
|
||||
int index;
|
||||
|
||||
nettype = get_word (&argument, ',');
|
||||
subchannels[0] = get_word (&argument, ',');
|
||||
subchannels[1] = get_word (&argument, ',');
|
||||
|
||||
if (nm_streq0 (nettype, "ctc")) {
|
||||
prefix = "sl";
|
||||
if (net_ifnames == TRUE) {
|
||||
prefix = "sl";
|
||||
} else {
|
||||
prefix = "ctc";
|
||||
index = count_ctc++;
|
||||
}
|
||||
} else {
|
||||
subchannels[2] = get_word (&argument, ',');
|
||||
prefix = "en";
|
||||
if (net_ifnames == TRUE) {
|
||||
prefix = "en";
|
||||
} else {
|
||||
prefix = "eth";
|
||||
index = count_eth++;
|
||||
}
|
||||
}
|
||||
|
||||
if (net_ifnames == TRUE) {
|
||||
|
|
@ -716,6 +729,8 @@ parse_rd_znet (GHashTable *connections, char *argument, gboolean net_ifnames)
|
|||
bus_id += bus_id_start < bus_id_len ? bus_id_start : bus_id_len - 1;
|
||||
|
||||
ifname = g_strdup_printf ("%sc%s", prefix, bus_id);
|
||||
} else {
|
||||
ifname = g_strdup_printf ("%s%d", prefix, index);
|
||||
}
|
||||
|
||||
connection = get_conn (connections, ifname, NM_SETTING_WIRED_SETTING_NAME);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue