From cfb80376641fa49137b9996130352697e7f8b436 Mon Sep 17 00:00:00 2001 From: Sebastien Bacher Date: Wed, 25 Aug 2021 15:23:22 +0200 Subject: New upstream version 1.32.10 --- src/nm-initrd-generator/nmi-cmdline-reader.c | 151 ++++++++++++++++++++++++--- 1 file changed, 136 insertions(+), 15 deletions(-) (limited to 'src/nm-initrd-generator/nmi-cmdline-reader.c') diff --git a/src/nm-initrd-generator/nmi-cmdline-reader.c b/src/nm-initrd-generator/nmi-cmdline-reader.c index 799fd5dc..5c42f83c 100644 --- a/src/nm-initrd-generator/nmi-cmdline-reader.c +++ b/src/nm-initrd-generator/nmi-cmdline-reader.c @@ -119,6 +119,8 @@ reader_create_connection(Reader * reader, reader->dhcp_timeout, NM_SETTING_IP4_CONFIG_DHCP_VENDOR_CLASS_IDENTIFIER, reader->dhcp4_vci, + NM_SETTING_IP_CONFIG_REQUIRED_TIMEOUT, + NMI_IP_REQUIRED_TIMEOUT_MSEC, NULL); setting = nm_setting_ip6_config_new(); @@ -401,18 +403,19 @@ reader_parse_ip(Reader *reader, const char *sysfs_dir, char *argument) gs_unref_hashtable GHashTable *ibft = NULL; const char * tmp; const char * tmp2; - const char * kind = NULL; - const char * client_ip = NULL; - const char * peer = NULL; - const char * gateway_ip = NULL; - const char * netmask = NULL; - const char * client_hostname = NULL; - const char * iface_spec = NULL; - const char * mtu = NULL; - const char * macaddr = NULL; - int client_ip_family = AF_UNSPEC; - int client_ip_prefix = -1; - const char * dns[2] = { + const char * kind = NULL; + const char * client_ip = NULL; + const char * peer = NULL; + const char * gateway_ip = NULL; + const char * netmask = NULL; + const char * client_hostname = NULL; + const char * iface_spec = NULL; + const char * mtu = NULL; + const char * macaddr = NULL; + int client_ip_family = AF_UNSPEC; + int client_ip_prefix = -1; + gboolean clear_ip4_required_timeout = TRUE; + const char * dns[2] = { NULL, NULL, }; @@ -436,6 +439,7 @@ reader_parse_ip(Reader *reader, const char *sysfs_dir, char *argument) "none", "off", "dhcp", + "single-dhcp", "on" "any", "dhcp6", @@ -601,7 +605,7 @@ reader_parse_ip(Reader *reader, const char *sysfs_dir, char *argument) NM_SETTING_IP4_CONFIG_METHOD_DISABLED, NULL); } - } else if (nm_streq0(kind, "dhcp")) { + } else if (NM_IN_STRSET(kind, "dhcp", "single-dhcp")) { g_object_set(s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, @@ -679,8 +683,13 @@ reader_parse_ip(Reader *reader, const char *sysfs_dir, char *argument) g_clear_error(&error); } } + } else { + clear_ip4_required_timeout = FALSE; } + if (clear_ip4_required_timeout) + g_object_set(s_ip4, NM_SETTING_IP_CONFIG_REQUIRED_TIMEOUT, -1, NULL); + if (peer && *peer) _LOGW(LOGD_CORE, "Ignoring peer: %s (not implemented)\n", peer); @@ -907,6 +916,56 @@ reader_parse_vlan(Reader *reader, char *argument) g_ptr_array_add(reader->vlan_parents, g_strdup(phy)); } +static void +reader_parse_ib_pkey(Reader *reader, char *argument) +{ + NMConnection * connection; + NMSettingInfiniband *s_ib; + char * ifname; + gs_free char * parent = NULL; + char * pkey; + gint64 pkey_int; + + /* At the moment we only support ib.pkey=.; + * in the future we want to possibly support other options: + * ib.pkey=.: