mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-11 20:00:35 +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
This commit is contained in:
parent
920e59016f
commit
390d79079e
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