mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 13:30:08 +01:00
initrd: merge branch 'bg/initrd-ipv6'
https://bugzilla.redhat.com/show_bug.cgi?id=1848943 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/548
This commit is contained in:
commit
4efd4e0a61
2 changed files with 16 additions and 5 deletions
|
|
@ -464,7 +464,7 @@ reader_parse_ip (Reader *reader, const char *sysfs_dir, char *argument)
|
|||
if (NM_IN_STRSET (kind, "none", "off")) {
|
||||
if (nm_setting_ip_config_get_num_addresses (s_ip6) == 0) {
|
||||
g_object_set (s_ip6,
|
||||
NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_DISABLED,
|
||||
NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
|
||||
NULL);
|
||||
}
|
||||
if (nm_setting_ip_config_get_num_addresses (s_ip4) == 0) {
|
||||
|
|
@ -479,7 +479,7 @@ reader_parse_ip (Reader *reader, const char *sysfs_dir, char *argument)
|
|||
NULL);
|
||||
if (nm_setting_ip_config_get_num_addresses (s_ip6) == 0) {
|
||||
g_object_set (s_ip6,
|
||||
NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
|
||||
NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
|
||||
NULL);
|
||||
}
|
||||
} else if (nm_streq0 (kind, "dhcp6")) {
|
||||
|
|
|
|||
|
|
@ -186,11 +186,12 @@ test_if_ip4_manual (void)
|
|||
{
|
||||
gs_unref_hashtable GHashTable *connections = NULL;
|
||||
const char *const*ARGV = NM_MAKE_STRV ("ip=192.0.2.2::192.0.2.1:255.255.255.0:"
|
||||
"hostname0.example.com:eth3::192.0.2.53",
|
||||
"hostname0.example.com:eth3:none:192.0.2.53",
|
||||
"ip=203.0.113.2::203.0.113.1:26:"
|
||||
"hostname1.example.com:eth4");
|
||||
NMConnection *connection;
|
||||
NMSettingIPConfig *s_ip4;
|
||||
NMSettingIPConfig *s_ip6;
|
||||
NMIPAddress *ip_addr;
|
||||
gs_free char *hostname = NULL;
|
||||
|
||||
|
|
@ -219,6 +220,11 @@ test_if_ip4_manual (void)
|
|||
g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, "192.0.2.1");
|
||||
g_assert_cmpstr (nm_setting_ip_config_get_dhcp_hostname (s_ip4), ==, "hostname0.example.com");
|
||||
|
||||
s_ip6 = nm_connection_get_setting_ip6_config (connection);
|
||||
g_assert (s_ip6);
|
||||
g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_AUTO);
|
||||
g_assert (nm_setting_ip_config_get_may_fail (s_ip6));
|
||||
|
||||
connection = g_hash_table_lookup (connections, "eth4");
|
||||
g_assert (connection);
|
||||
nmtst_assert_connection_verifies_without_normalization (connection);
|
||||
|
|
@ -237,6 +243,11 @@ test_if_ip4_manual (void)
|
|||
g_assert_cmpint (nm_ip_address_get_prefix (ip_addr), ==, 26);
|
||||
g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, "203.0.113.1");
|
||||
g_assert_cmpstr (nm_setting_ip_config_get_dhcp_hostname (s_ip4), ==, "hostname1.example.com");
|
||||
|
||||
s_ip6 = nm_connection_get_setting_ip6_config (connection);
|
||||
g_assert (s_ip6);
|
||||
g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_AUTO);
|
||||
g_assert (nm_setting_ip_config_get_may_fail (s_ip6));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1086,7 +1097,7 @@ test_bootif (void)
|
|||
|
||||
s_ip6 = nm_connection_get_setting_ip6_config (connection);
|
||||
g_assert (s_ip6);
|
||||
g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_IGNORE);
|
||||
g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_AUTO);
|
||||
g_assert (!nm_setting_ip_config_get_ignore_auto_dns (s_ip6));
|
||||
}
|
||||
|
||||
|
|
@ -1124,7 +1135,7 @@ test_bootif_hwtype (void)
|
|||
|
||||
s_ip6 = nm_connection_get_setting_ip6_config (connection);
|
||||
g_assert (s_ip6);
|
||||
g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_IGNORE);
|
||||
g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_AUTO);
|
||||
g_assert (!nm_setting_ip_config_get_ignore_auto_dns (s_ip6));
|
||||
|
||||
connection = g_hash_table_lookup (connections, "bootif_connection");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue