mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 11:40:08 +01:00
initrd: allow specifying the net mask in form of a prefix
This is not documented in dracut.cmdline(7), however it seems to have
worked and has users and Red Hat even seems to recommend this (thanks to
Dan Horak for the pointers):
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/chap-installer-booting-ipl-s390
https://bugzilla.redhat.com/show_bug.cgi?id=1725872
(cherry picked from commit 390d79079e)
This commit is contained in:
parent
c0b2950282
commit
fe803a577c
1 changed files with 5 additions and 3 deletions
|
|
@ -270,11 +270,13 @@ parse_ip (GHashTable *connections, const char *sysfs_dir, char *argument)
|
|||
if (netmask && *netmask) {
|
||||
NMIPAddr addr;
|
||||
|
||||
if (nm_utils_parse_inaddr_bin (AF_INET, netmask, NULL, &addr)) {
|
||||
if (nm_utils_parse_inaddr_bin (AF_INET, netmask, NULL, &addr))
|
||||
client_ip_prefix = nm_utils_ip4_netmask_to_prefix (addr.addr4);
|
||||
} else {
|
||||
else
|
||||
client_ip_prefix = _nm_utils_ascii_str_to_int64 (netmask, 10, 0, 32, -1);
|
||||
|
||||
if (client_ip_prefix == -1)
|
||||
_LOGW (LOGD_CORE, "Invalid IP mask: %s", netmask);
|
||||
}
|
||||
}
|
||||
|
||||
/* Static IP configuration might be present. */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue