Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 665388 Details for
Bug 830434
Omits "IPV6INIT=yes" from kickstart-generated ifcfg-* file
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
[PATCH] ifcfg-rh: treat missing IPv6 setting as IPv6 "auto" method (rh #830434)
0001-ifcfg-rh-treat-missing-IPv6-setting-as-IPv6-auto-met.patch (text/plain), 6.89 KB, created by
Jirka Klimes
on 2012-12-18 09:55:07 UTC
(
hide
)
Description:
[PATCH] ifcfg-rh: treat missing IPv6 setting as IPv6 "auto" method (rh #830434)
Filename:
MIME Type:
Creator:
Jirka Klimes
Created:
2012-12-18 09:55:07 UTC
Size:
6.89 KB
patch
obsolete
>From 954ce65e9968be45378b4f81f05387eac847b33f Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com> >Date: Mon, 17 Dec 2012 16:33:02 +0100 >Subject: [PATCH] ifcfg-rh: treat missing IPv6 setting as IPv6 "auto" method > (rh #830434) >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > > >Signed-off-by: JiÅà KlimeÅ¡ <jklimes@redhat.com> >--- > .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 119 +++++++++++++++++++++ > src/settings/plugins/ifcfg-rh/writer.c | 18 ++-- > 2 files changed, 130 insertions(+), 7 deletions(-) > >diff --git a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c >index 2b8df27..fcad170 100644 >--- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c >+++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c >@@ -12508,6 +12508,124 @@ test_write_vlan_only_vlanid (void) > g_object_unref (reread); > } > >+static void >+test_write_ethernet_missing_ipv6 (void) >+{ >+ NMConnection *connection; >+ NMConnection *reread; >+ NMSettingConnection *s_con; >+ NMSettingWired *s_wired; >+ NMSettingIP4Config *s_ip4; >+ NMSettingIP6Config *s_ip6; >+ char *uuid; >+ gboolean success; >+ GError *error = NULL; >+ char *testfile = NULL; >+ char *unmanaged = NULL; >+ char *keyfile = NULL; >+ char *routefile = NULL; >+ char *route6file = NULL; >+ gboolean ignore_error = FALSE; >+ >+ connection = nm_connection_new (); >+ g_assert (connection); >+ >+ /* Connection setting */ >+ s_con = (NMSettingConnection *) nm_setting_connection_new (); >+ g_assert (s_con); >+ nm_connection_add_setting (connection, NM_SETTING (s_con)); >+ >+ uuid = nm_utils_uuid_generate (); >+ g_object_set (s_con, >+ NM_SETTING_CONNECTION_ID, "Test Write Ethernet Without IPv6 Setting", >+ NM_SETTING_CONNECTION_UUID, uuid, >+ NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, >+ NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, >+ NULL); >+ g_free (uuid); >+ >+ /* Wired setting */ >+ s_wired = (NMSettingWired *) nm_setting_wired_new (); >+ g_assert (s_wired); >+ nm_connection_add_setting (connection, NM_SETTING (s_wired)); >+ >+ /* IP4 setting */ >+ s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); >+ g_assert (s_ip4); >+ nm_connection_add_setting (connection, NM_SETTING (s_ip4)); >+ g_object_set (s_ip4, >+ NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, >+ NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, "random-client-id-00:22:33", >+ NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, TRUE, >+ NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, TRUE, >+ NULL); >+ >+ /* IP6 setting */ >+ /* >+ * We intentionally don't add IPv6 setting here. ifcfg-rh plugin should regard >+ * missing IPv6 as IPv6 with NM_SETTING_IP6_CONFIG_METHOD_AUTO method. >+ */ >+ >+ ASSERT (nm_connection_verify (connection, &error) == TRUE, >+ "ethernet-missing-ipv6", "failed to verify connection: %s", >+ (error && error->message) ? error->message : "(unknown)"); >+ >+ /* Save the ifcfg */ >+ success = writer_new_connection (connection, >+ TEST_SCRATCH_DIR "/network-scripts/", >+ &testfile, >+ &error); >+ ASSERT (success == TRUE, >+ "ethernet-missing-ipv6", "failed to write connection to disk: %s", >+ (error && error->message) ? error->message : "(unknown)"); >+ >+ ASSERT (testfile != NULL, >+ "ethernet-missing-ipv6", "didn't get ifcfg file path back after writing connection"); >+ >+ /* re-read the connection for comparison */ >+ reread = connection_from_file (testfile, >+ NULL, >+ TYPE_ETHERNET, >+ NULL, >+ &unmanaged, >+ &keyfile, >+ &routefile, >+ &route6file, >+ &error, >+ &ignore_error); >+ unlink (testfile); >+ >+ ASSERT (reread != NULL, >+ "ethernet-missing-ipv6-reread", "failed to read %s: %s", testfile, error->message); >+ >+ ASSERT (nm_connection_verify (reread, &error), >+ "ethernet-missing-ipv6-reread-verify", "failed to verify %s: %s", testfile, error->message); >+ >+ /* >+ * We need to add IPv6 setting to the original connection now so that >+ * the comparison can succeed. Missing IPv6 setting should have been >+ * written out (and re-read) as Automatic IPv6. >+ */ >+ s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); >+ g_assert (s_ip6); >+ nm_connection_add_setting (connection, NM_SETTING (s_ip6)); >+ g_object_set (s_ip6, >+ NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, >+ NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE, >+ NULL); >+ >+ ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, >+ "ethernet-missing-ipv6", "written and re-read connection weren't the same."); >+ >+ g_free (testfile); >+ g_free (unmanaged); >+ g_free (keyfile); >+ g_free (routefile); >+ g_free (route6file); >+ g_object_unref (connection); >+ g_object_unref (reread); >+} >+ > #define TEST_IFCFG_BOND_MAIN TEST_IFCFG_DIR"/network-scripts/ifcfg-test-bond-main" > > static void >@@ -13403,6 +13521,7 @@ int main (int argc, char **argv) > test_write_infiniband (); > test_write_vlan (); > test_write_vlan_only_vlanid (); >+ test_write_ethernet_missing_ipv6 (); > > /* iSCSI / ibft */ > test_read_ibft_dhcp (); >diff --git a/src/settings/plugins/ifcfg-rh/writer.c b/src/settings/plugins/ifcfg-rh/writer.c >index f0ee023..e258081 100644 >--- a/src/settings/plugins/ifcfg-rh/writer.c >+++ b/src/settings/plugins/ifcfg-rh/writer.c >@@ -1897,9 +1897,15 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) > > s_ip6 = nm_connection_get_setting_ip6_config (connection); > if (!s_ip6) { >- g_set_error (error, IFCFG_PLUGIN_ERROR, 0, >- "Missing '%s' setting", NM_SETTING_IP6_CONFIG_SETTING_NAME); >- return FALSE; >+ /* Treat missing IPv6 setting as a setting with method "auto" */ >+ svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); >+ svSetValue (ifcfg, "IPV6_AUTOCONF", "yes", FALSE); >+ svSetValue (ifcfg, "DHCPV6C", NULL, FALSE); >+ svSetValue (ifcfg, "IPV6_DEFROUTE", "yes", FALSE); >+ svSetValue (ifcfg, "IPV6_PEERDNS", "yes", FALSE); >+ svSetValue (ifcfg, "IPV6_PEERROUTES", "yes", FALSE); >+ svSetValue (ifcfg, "IPV6_FAILURE_FATAL", "no", FALSE); >+ return TRUE; > } > > value = nm_setting_ip6_config_get_method (s_ip6); >@@ -2210,10 +2216,8 @@ write_connection (NMConnection *connection, > if (!write_ip4_setting (connection, ifcfg, error)) > goto out; > >- if (nm_connection_get_setting_ip6_config (connection)) { >- if (!write_ip6_setting (connection, ifcfg, error)) >- goto out; >- } >+ if (!write_ip6_setting (connection, ifcfg, error)) >+ goto out; > } > > write_connection_setting (s_con, ifcfg); >-- >1.7.11.7 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 830434
:
664934
| 665388