From 94180d84de647b89dc53dba2852447422dbc86a9 Mon Sep 17 00:00:00 2001 From: CentOS Buildsys Date: Apr 07 2014 21:15:26 +0000 Subject: import NetworkManager-0.9.9.1-12.git20140326.4dba720.el7.src.rpm --- diff --git a/.NetworkManager.metadata b/.NetworkManager.metadata index e59d0db..4c9adb5 100644 --- a/.NetworkManager.metadata +++ b/.NetworkManager.metadata @@ -1,2 +1 @@ -ab15eeb9ae37eeebb9b2c47d3e6e991bc98de3c6 SOURCES/nmtui-0.0.1.tar.xz -91b9fc66e273c87925efdad1cb789ce4fcbf8f84 SOURCES/NetworkManager-0.9.9.0.git20131108.tar.bz2 +3735e51b63b34b382b6f52525c9dd2db3c25480e SOURCES/NetworkManager-0.9.9.1.git20140326.4dba720.tar.bz2 diff --git a/SOURCES/0001-explain-dns1-dns2.patch b/SOURCES/0001-explain-dns1-dns2.patch new file mode 100644 index 0000000..e31a0eb --- /dev/null +++ b/SOURCES/0001-explain-dns1-dns2.patch @@ -0,0 +1,27 @@ +diff -up NetworkManager-0.8.2/src/dns-manager/nm-dns-manager.c.explain-dns1-dns2 NetworkManager-0.8.2/src/dns-manager/nm-dns-manager.c +--- NetworkManager-0.8.2/src/dns-manager/nm-dns-manager.c.explain-dns1-dns2 2010-10-18 18:44:05.000000000 -0500 ++++ NetworkManager-0.8.2/src/dns-manager/nm-dns-manager.c 2010-11-03 13:51:56.614584001 -0500 +@@ -358,7 +358,7 @@ write_resolv_conf (FILE *f, const char * + + str = g_string_new (""); + +- if (nameservers) { ++ if (nameservers && g_strv_length (nameservers)) { + int num = g_strv_length (nameservers); + + for (i = 0; i < num; i++) { +@@ -374,6 +374,14 @@ write_resolv_conf (FILE *f, const char * + g_string_append (str, nameservers[i]); + g_string_append_c (str, '\n'); + } ++ } else { ++ g_string_append_printf (str, "\n\n%s%s%s%s%s%s", ++ "# No nameservers found; try putting DNS servers into your\n", ++ "# ifcfg files in /etc/sysconfig/network-scripts like so:\n", ++ "#\n", ++ "# DNS1=xxx.xxx.xxx.xxx\n", ++ "# DNS2=xxx.xxx.xxx.xxx\n", ++ "# DOMAIN=lab.foo.com bar.foo.com\n"); + } + + nameservers_str = g_string_free (str, FALSE); diff --git a/SOURCES/0001-fix-build-with-newt-0.52.15.patch b/SOURCES/0001-fix-build-with-newt-0.52.15.patch deleted file mode 100644 index 455fbce..0000000 --- a/SOURCES/0001-fix-build-with-newt-0.52.15.patch +++ /dev/null @@ -1,24 +0,0 @@ -From db5beed85ae8e9cf35ed94d2e3c78c6b469b2d63 Mon Sep 17 00:00:00 2001 -From: Dan Winship -Date: Mon, 4 Nov 2013 10:47:48 -0500 -Subject: [PATCH] fix build with newt 0.52.15 - ---- - nmt-newt-popup.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/nmt-newt-popup.c b/nmt-newt-popup.c -index f6c427e..6f37243 100644 ---- a/nmtui-0.0.1/nmt-newt-popup.c -+++ b/nmtui-0.0.1/nmt-newt-popup.c -@@ -22,6 +22,7 @@ - - #include "nmt-newt-popup.h" - #include "nmt-newt-form.h" -+#include "nmt-newt-hacks.h" - #include "nmt-newt-listbox.h" - #include "nmt-newt-utils.h" - --- -1.8.4.2 - diff --git a/SOURCES/README.nmcs b/SOURCES/README.nmcs new file mode 100644 index 0000000..49ffe08 --- /dev/null +++ b/SOURCES/README.nmcs @@ -0,0 +1,12 @@ +NOTE: if NetworkManager is not installed or not enabled, the configuration +added by this package has *no effect*. + +The NetworkManager-config-server package a NetworkManager configuration file +to make it behave more like the old "network" service. In particular, it +prevents NetworkManager from automatically running DHCP on unconfigured +ethernet devices, and allows connections with static IP addresses to be +brought up even on ethernet devices with no carrier. + +This package is intended to be installed by default for server +deployments. + diff --git a/SOURCES/explain-dns1-dns2.patch b/SOURCES/explain-dns1-dns2.patch deleted file mode 100644 index e31a0eb..0000000 --- a/SOURCES/explain-dns1-dns2.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff -up NetworkManager-0.8.2/src/dns-manager/nm-dns-manager.c.explain-dns1-dns2 NetworkManager-0.8.2/src/dns-manager/nm-dns-manager.c ---- NetworkManager-0.8.2/src/dns-manager/nm-dns-manager.c.explain-dns1-dns2 2010-10-18 18:44:05.000000000 -0500 -+++ NetworkManager-0.8.2/src/dns-manager/nm-dns-manager.c 2010-11-03 13:51:56.614584001 -0500 -@@ -358,7 +358,7 @@ write_resolv_conf (FILE *f, const char * - - str = g_string_new (""); - -- if (nameservers) { -+ if (nameservers && g_strv_length (nameservers)) { - int num = g_strv_length (nameservers); - - for (i = 0; i < num; i++) { -@@ -374,6 +374,14 @@ write_resolv_conf (FILE *f, const char * - g_string_append (str, nameservers[i]); - g_string_append_c (str, '\n'); - } -+ } else { -+ g_string_append_printf (str, "\n\n%s%s%s%s%s%s", -+ "# No nameservers found; try putting DNS servers into your\n", -+ "# ifcfg files in /etc/sysconfig/network-scripts like so:\n", -+ "#\n", -+ "# DNS1=xxx.xxx.xxx.xxx\n", -+ "# DNS2=xxx.xxx.xxx.xxx\n", -+ "# DOMAIN=lab.foo.com bar.foo.com\n"); - } - - nameservers_str = g_string_free (str, FALSE); diff --git a/SOURCES/rh1029464-settings-convert-NMDefaultWiredConnection-into-a-pla.patch b/SOURCES/rh1029464-settings-convert-NMDefaultWiredConnection-into-a-pla.patch deleted file mode 100644 index 01b51a6..0000000 --- a/SOURCES/rh1029464-settings-convert-NMDefaultWiredConnection-into-a-pla.patch +++ /dev/null @@ -1,710 +0,0 @@ -From 49983db85eb0c4737271b27e83e70c1216419096 Mon Sep 17 00:00:00 2001 -From: Dan Williams -Date: Tue, 12 Nov 2013 14:26:20 -0600 -Subject: [PATCH] settings: convert NMDefaultWiredConnection into a plain - NMSettingsConnection (rh #1029464) (bgo #712188) - -Changing the default wired connection has always deleted the connection -(thus disconnecting the interface) and re-added it as a settings plugin -connection. That was always sub-optimal, but until the 'unsaved' connection -stuff landed this summer, we couldn't do anything about that. Clean -that all up, adding the connection as an unsaved connection right from -the start, which allows changes to the connection without having to -delete and recreate it, thus preventing disconnection of any interface -that is using the connection. - -A new signal is added to NMSettingsConnection that is only emitted when -the connection is changed from D-Bus (thus indicating an explicit user- -requested change) since the connection may be modified internally by -NetworkManager. NM-triggered changes should not result in the connection -no longer being a default-wired connection. - -https://bugzilla.gnome.org/show_bug.cgi?id=712188 -https://bugzilla.redhat.com/show_bug.cgi?id=1029464 ---- - src/Makefile.am | 2 - - src/settings/nm-default-wired-connection.c | 190 --------------------------- - src/settings/nm-default-wired-connection.h | 55 -------- - src/settings/nm-settings-connection.c | 14 ++ - src/settings/nm-settings-connection.h | 3 + - src/settings/nm-settings.c | 204 ++++++++++++++--------------- - 6 files changed, 119 insertions(+), 349 deletions(-) - delete mode 100644 src/settings/nm-default-wired-connection.c - delete mode 100644 src/settings/nm-default-wired-connection.h - -diff --git a/src/Makefile.am b/src/Makefile.am -index bcac9ac..34b7339 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -159,16 +159,14 @@ nm_sources = \ - \ - ppp-manager/nm-ppp-manager.c \ - ppp-manager/nm-ppp-manager.h \ - ppp-manager/nm-ppp-status.h \ - \ - settings/nm-agent-manager.c \ - settings/nm-agent-manager.h \ -- settings/nm-default-wired-connection.c \ -- settings/nm-default-wired-connection.h \ - settings/nm-inotify-helper.c \ - settings/nm-inotify-helper.h \ - settings/nm-secret-agent.c \ - settings/nm-secret-agent.h \ - settings/nm-settings-connection.c \ - settings/nm-settings-connection.h \ - settings/nm-settings-error.c \ -diff --git a/src/settings/nm-default-wired-connection.c b/src/settings/nm-default-wired-connection.c -deleted file mode 100644 -index 6c8ce41..0000000 ---- a/src/settings/nm-default-wired-connection.c -+++ /dev/null -@@ -1,190 +0,0 @@ --/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ --/* NetworkManager system settings service -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License along -- * with this program; if not, write to the Free Software Foundation, Inc., -- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -- * -- * (C) Copyright 2008 Novell, Inc. -- * (C) Copyright 2009 - 2011 Red Hat, Inc. -- */ -- --#include "config.h" -- --#include -- --#include --#include --#include --#include -- --#include "nm-dbus-glib-types.h" --#include "nm-default-wired-connection.h" --#include "nm-device-ethernet.h" -- --G_DEFINE_TYPE (NMDefaultWiredConnection, nm_default_wired_connection, NM_TYPE_SETTINGS_CONNECTION) -- --#define NM_DEFAULT_WIRED_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEFAULT_WIRED_CONNECTION, NMDefaultWiredConnectionPrivate)) -- --typedef struct { -- NMDevice *device; --} NMDefaultWiredConnectionPrivate; -- --enum { -- TRY_UPDATE, -- DELETED, -- LAST_SIGNAL --}; -- --static guint signals[LAST_SIGNAL] = { 0 }; -- --/****************************************************************/ -- --NMDevice * --nm_default_wired_connection_get_device (NMDefaultWiredConnection *wired) --{ -- g_return_val_if_fail (NM_IS_DEFAULT_WIRED_CONNECTION (wired), NULL); -- -- return NM_DEFAULT_WIRED_CONNECTION_GET_PRIVATE (wired)->device; --} -- --static void --commit_changes (NMSettingsConnection *connection, -- NMSettingsConnectionCommitFunc callback, -- gpointer user_data) --{ -- NMDefaultWiredConnection *self = NM_DEFAULT_WIRED_CONNECTION (connection); -- -- /* Keep the object alive over try-update since it might get removed -- * from the settings service there, but we still need it for the callback. -- */ -- g_object_ref (connection); -- g_signal_emit (self, signals[TRY_UPDATE], 0); -- callback (connection, NULL, user_data); -- g_object_unref (connection); --} -- --static void --do_delete (NMSettingsConnection *connection, -- NMSettingsConnectionDeleteFunc callback, -- gpointer user_data) --{ -- g_signal_emit (connection, signals[DELETED], 0); -- NM_SETTINGS_CONNECTION_CLASS (nm_default_wired_connection_parent_class)->delete (connection, -- callback, -- user_data); --} -- --/****************************************************************/ -- --NMDefaultWiredConnection * --nm_default_wired_connection_new (NMDevice *device, -- const char *defname, -- gboolean read_only) --{ -- NMDefaultWiredConnection *self; -- NMDefaultWiredConnectionPrivate *priv; -- NMSetting *setting; -- char *uuid; -- const guint8 *hw_address; -- guint len = 0; -- GByteArray *mac; -- -- g_return_val_if_fail (NM_IS_DEVICE_ETHERNET (device), NULL); -- g_return_val_if_fail (defname != NULL, NULL); -- -- self = (NMDefaultWiredConnection *) g_object_new (NM_TYPE_DEFAULT_WIRED_CONNECTION, NULL); -- -- priv = NM_DEFAULT_WIRED_CONNECTION_GET_PRIVATE (self); -- priv->device = g_object_ref (device); -- -- setting = nm_setting_connection_new (); -- -- uuid = nm_utils_uuid_generate (); -- g_object_set (setting, -- NM_SETTING_CONNECTION_ID, defname, -- NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, -- NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, -- NM_SETTING_CONNECTION_UUID, uuid, -- NM_SETTING_CONNECTION_READ_ONLY, read_only, -- NM_SETTING_CONNECTION_TIMESTAMP, (guint64) time (NULL), -- NULL); -- g_free (uuid); -- -- nm_connection_add_setting (NM_CONNECTION (self), setting); -- -- /* Lock the connection to the specific device */ -- hw_address = nm_device_get_hw_address (device, &len); -- mac = g_byte_array_sized_new (len); -- g_byte_array_append (mac, hw_address, len); -- -- setting = nm_setting_wired_new (); -- g_object_set (setting, NM_SETTING_WIRED_MAC_ADDRESS, mac, NULL); -- nm_connection_add_setting (NM_CONNECTION (self), setting); -- -- g_byte_array_unref (mac); -- -- return self; --} -- --static void --nm_default_wired_connection_init (NMDefaultWiredConnection *self) --{ --} -- --static void --dispose (GObject *object) --{ -- NMDefaultWiredConnectionPrivate *priv = NM_DEFAULT_WIRED_CONNECTION_GET_PRIVATE (object); -- -- g_clear_object (&priv->device); -- -- G_OBJECT_CLASS (nm_default_wired_connection_parent_class)->dispose (object); --} -- --static void --nm_default_wired_connection_class_init (NMDefaultWiredConnectionClass *klass) --{ -- GObjectClass *object_class = G_OBJECT_CLASS (klass); -- NMSettingsConnectionClass *settings_class = NM_SETTINGS_CONNECTION_CLASS (klass); -- -- g_type_class_add_private (klass, sizeof (NMDefaultWiredConnectionPrivate)); -- -- /* Virtual methods */ -- object_class->dispose = dispose; -- settings_class->commit_changes = commit_changes; -- settings_class->delete = do_delete; -- -- /* Signals */ -- signals[TRY_UPDATE] = -- g_signal_new ("try-update", -- G_OBJECT_CLASS_TYPE (object_class), -- G_SIGNAL_RUN_LAST, -- 0, NULL, NULL, -- g_cclosure_marshal_VOID__VOID, -- G_TYPE_NONE, 0); -- -- /* The 'deleted' signal is used to signal intentional deletions (like -- * updating or user-requested deletion) rather than using the -- * superclass' 'removed' signal, since that signal doesn't have the -- * semantics we want; it gets emitted as a side-effect of various operations -- * and is meant more for D-Bus clients instead of in-service uses. -- */ -- signals[DELETED] = -- g_signal_new ("deleted", -- G_OBJECT_CLASS_TYPE (object_class), -- G_SIGNAL_RUN_LAST, -- 0, NULL, NULL, -- g_cclosure_marshal_VOID__VOID, -- G_TYPE_NONE, 0); --} -diff --git a/src/settings/nm-default-wired-connection.h b/src/settings/nm-default-wired-connection.h -deleted file mode 100644 -index 3661a7b..0000000 ---- a/src/settings/nm-default-wired-connection.h -+++ /dev/null -@@ -1,55 +0,0 @@ --/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ --/* NetworkManager system settings service -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License along -- * with this program; if not, write to the Free Software Foundation, Inc., -- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -- * -- * (C) Copyright 2008 Novell, Inc. -- * (C) Copyright 2009 - 2011 Red Hat, Inc. -- */ -- --#ifndef NM_DEFAULT_WIRED_CONNECTION_H --#define NM_DEFAULT_WIRED_CONNECTION_H -- --#include "nm-settings-connection.h" --#include "nm-device.h" -- --G_BEGIN_DECLS -- --#define NM_TYPE_DEFAULT_WIRED_CONNECTION (nm_default_wired_connection_get_type ()) --#define NM_DEFAULT_WIRED_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEFAULT_WIRED_CONNECTION, NMDefaultWiredConnection)) --#define NM_DEFAULT_WIRED_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEFAULT_WIRED_CONNECTION, NMDefaultWiredConnectionClass)) --#define NM_IS_DEFAULT_WIRED_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEFAULT_WIRED_CONNECTION)) --#define NM_IS_DEFAULT_WIRED_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEFAULT_WIRED_CONNECTION)) --#define NM_DEFAULT_WIRED_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEFAULT_WIRED_CONNECTION, NMDefaultWiredConnectionClass)) -- --typedef struct { -- NMSettingsConnection parent; --} NMDefaultWiredConnection; -- --typedef struct { -- NMSettingsConnectionClass parent; --} NMDefaultWiredConnectionClass; -- --GType nm_default_wired_connection_get_type (void); -- --NMDefaultWiredConnection *nm_default_wired_connection_new (NMDevice *device, -- const char *defname, -- gboolean read_only); -- --NMDevice *nm_default_wired_connection_get_device (NMDefaultWiredConnection *wired); -- --G_END_DECLS -- --#endif /* NM_DEFAULT_WIRED_CONNECTION_H */ -diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c -index f1bc3c3..53c606f 100644 ---- a/src/settings/nm-settings-connection.c -+++ b/src/settings/nm-settings-connection.c -@@ -79,14 +79,15 @@ enum { - PROP_VISIBLE, - PROP_UNSAVED, - }; - - enum { - UPDATED, - REMOVED, -+ DBUS_UPDATED, - LAST_SIGNAL - }; - static guint signals[LAST_SIGNAL] = { 0 }; - - typedef struct { - gboolean disposed; - -@@ -1232,14 +1233,16 @@ con_update_cb (NMSettingsConnection *self, - */ - for_agent = nm_connection_duplicate (NM_CONNECTION (self)); - nm_connection_clear_secrets_with_flags (for_agent, - secrets_filter_cb, - GUINT_TO_POINTER (NM_SETTING_SECRET_FLAG_AGENT_OWNED)); - nm_agent_manager_save_secrets (info->agent_mgr, for_agent, TRUE, info->sender_uid); - g_object_unref (for_agent); -+ -+ g_signal_emit (self, signals[DBUS_UPDATED], 0); - } - - update_complete (self, info, error); - } - - static void - update_auth_cb (NMSettingsConnection *self, -@@ -2031,23 +2034,34 @@ nm_settings_connection_class_init (NMSettingsConnectionClass *class) - "TRUE when the connection has not yet been saved " - "to permanent storage (eg disk) or when it " - "has been changed but not yet saved.", - FALSE, - G_PARAM_READABLE)); - - /* Signals */ -+ -+ /* Emitted when the connection is changed for any reason */ - signals[UPDATED] = - g_signal_new (NM_SETTINGS_CONNECTION_UPDATED, - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_FIRST, - 0, - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - -+ /* Emitted when connection is changed from D-Bus */ -+ signals[DBUS_UPDATED] = -+ g_signal_new (NM_SETTINGS_CONNECTION_DBUS_UPDATED, -+ G_TYPE_FROM_CLASS (class), -+ G_SIGNAL_RUN_FIRST, -+ 0, NULL, NULL, -+ g_cclosure_marshal_VOID__VOID, -+ G_TYPE_NONE, 0); -+ - signals[REMOVED] = - g_signal_new (NM_SETTINGS_CONNECTION_REMOVED, - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_FIRST, - 0, - NULL, NULL, - g_cclosure_marshal_VOID__VOID, -diff --git a/src/settings/nm-settings-connection.h b/src/settings/nm-settings-connection.h -index 8b995ab..a687ddb 100644 ---- a/src/settings/nm-settings-connection.h -+++ b/src/settings/nm-settings-connection.h -@@ -37,14 +37,17 @@ G_BEGIN_DECLS - - /* Signals */ - #define NM_SETTINGS_CONNECTION_UPDATED "updated" - #define NM_SETTINGS_CONNECTION_REMOVED "removed" - #define NM_SETTINGS_CONNECTION_GET_SECRETS "get-secrets" - #define NM_SETTINGS_CONNECTION_CANCEL_SECRETS "cancel-secrets" - -+/* Emitted when connection is changed from D-Bus */ -+#define NM_SETTINGS_CONNECTION_DBUS_UPDATED "dbus-updated" -+ - /* Properties */ - #define NM_SETTINGS_CONNECTION_VISIBLE "visible" - #define NM_SETTINGS_CONNECTION_UNSAVED "unsaved" - - typedef struct _NMSettingsConnection NMSettingsConnection; - typedef struct _NMSettingsConnectionClass NMSettingsConnectionClass; - -diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c -index 49d64d1..e384a17 100644 ---- a/src/settings/nm-settings.c -+++ b/src/settings/nm-settings.c -@@ -54,15 +54,14 @@ - #include - - #include "nm-device-ethernet.h" - #include "nm-dbus-glib-types.h" - #include "nm-settings.h" - #include "nm-settings-connection.h" - #include "nm-settings-error.h" --#include "nm-default-wired-connection.h" - #include "nm-logging.h" - #include "nm-dbus-manager.h" - #include "nm-manager-auth.h" - #include "nm-session-monitor.h" - #include "plugins/keyfile/plugin.h" - #include "nm-agent-manager.h" - #include "nm-settings-utils.h" -@@ -874,29 +873,14 @@ claim_connection (NMSettings *self, - g_signal_emit_by_name (self, NM_CP_SIGNAL_CONNECTION_ADDED, connection); - - /* Exported D-Bus signal */ - g_signal_emit (self, signals[NEW_CONNECTION], 0, connection); - } - } - --static void --remove_default_wired_connection (NMSettings *self, -- NMSettingsConnection *connection, -- gboolean do_signal) --{ -- NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE (self); -- const char *path = nm_connection_get_path (NM_CONNECTION (connection)); -- -- if (g_hash_table_lookup (priv->connections, path)) { -- if (do_signal) -- g_signal_emit_by_name (G_OBJECT (connection), NM_SETTINGS_CONNECTION_REMOVED); -- g_hash_table_remove (priv->connections, path); -- } --} -- - /** - * nm_settings_add_connection: - * @self: the #NMSettings object - * @connection: the source connection to create a new #NMSettingsConnection from - * @save_to_disk: %TRUE to save the connection to disk immediately, %FALSE to - * not save to disk - * @error: on return, a location to store any errors that may occur -@@ -1483,148 +1467,164 @@ have_connection_for_device (NMSettings *self, NMDevice *device) - /* See if there's a known non-NetworkManager configuration for the device */ - if (nm_device_spec_match_list (device, priv->unrecognized_specs)) - return TRUE; - - return FALSE; - } - --#define DEFAULT_WIRED_TAG "default-wired" -+#define DEFAULT_WIRED_CONNECTION_TAG "default-wired-connection" -+#define DEFAULT_WIRED_DEVICE_TAG "default-wired-device" -+ -+static void default_wired_clear_tag (NMSettings *self, -+ NMDevice *device, -+ NMSettingsConnection *connection, -+ gboolean add_to_no_auto_default); - - static void --default_wired_deleted (NMDefaultWiredConnection *wired, -- NMSettings *self) -+default_wired_connection_removed_cb (NMSettingsConnection *connection, NMSettings *self) - { -- NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE (self); - NMDevice *device; -- NMSettingConnection *s_con; - -- device = nm_default_wired_connection_get_device (wired); -- g_object_set_data (G_OBJECT (device), DEFAULT_WIRED_TAG, NULL); -- -- s_con = nm_connection_get_setting_connection (NM_CONNECTION (wired)); -- g_assert (s_con); -- -- /* Ignore removals of read-only connections, since they couldn't have -- * been removed by the user. -- */ -- if (nm_setting_connection_get_read_only (s_con)) -- return; -- -- /* When the default wired connection is removed (either deleted or saved -- * to a new persistent connection by a plugin), write the MAC address of -- * the wired device to the config file and don't create a new default wired -+ /* When the default wired connection is removed (either deleted or saved to -+ * a new persistent connection by a plugin), write the MAC address of the -+ * wired device to the config file and don't create a new default wired - * connection for that device again. - */ -- nm_config_set_ethernet_no_auto_default (priv->config, NM_CONFIG_DEVICE (device)); -+ device = g_object_get_data (G_OBJECT (connection), DEFAULT_WIRED_DEVICE_TAG); -+ if (device) -+ default_wired_clear_tag (self, device, connection, TRUE); - } - - static void --delete_cb (NMSettingsConnection *connection, GError *error, gpointer user_data) -+default_wired_connection_dbus_updated_cb (NMSettingsConnection *connection, NMSettings *self) - { --} -- --static void --default_wired_try_update (NMDefaultWiredConnection *wired, -- NMSettings *self) --{ -- GError *error = NULL; -- const char *id; -- NMSettingsConnection *added; -+ NMDevice *device; - -- /* Try to move this default wired conneciton to a plugin so that it has -- * persistent storage. -+ /* The connection has been changed by the user, it should no longer be -+ * considered a default wired connection, and should no longer affect -+ * the no-auto-default configuration option. - */ -+ device = g_object_get_data (G_OBJECT (connection), DEFAULT_WIRED_DEVICE_TAG); -+ if (device) -+ default_wired_clear_tag (self, device, connection, FALSE); -+} - -- /* Keep it alive over removal so we can re-add it if we need to */ -- g_object_ref (wired); -+static void -+default_wired_clear_tag (NMSettings *self, -+ NMDevice *device, -+ NMSettingsConnection *connection, -+ gboolean add_to_no_auto_default) -+{ -+ g_return_if_fail (NM_IS_SETTINGS (self)); -+ g_return_if_fail (NM_IS_DEVICE (device)); -+ g_return_if_fail (NM_IS_CONNECTION (connection)); -+ g_return_if_fail (device == g_object_get_data (G_OBJECT (connection), DEFAULT_WIRED_DEVICE_TAG)); -+ g_return_if_fail (connection == g_object_get_data (G_OBJECT (device), DEFAULT_WIRED_CONNECTION_TAG)); - -- id = nm_connection_get_id (NM_CONNECTION (wired)); -- g_assert (id); -+ g_object_set_data (G_OBJECT (connection), DEFAULT_WIRED_DEVICE_TAG, NULL); -+ g_object_set_data (G_OBJECT (device), DEFAULT_WIRED_CONNECTION_TAG, NULL); - -- remove_default_wired_connection (self, NM_SETTINGS_CONNECTION (wired), FALSE); -- added = nm_settings_add_connection (self, NM_CONNECTION (wired), TRUE, &error); -- if (added) { -- nm_settings_connection_delete (NM_SETTINGS_CONNECTION (wired), delete_cb, NULL); -+ g_signal_handlers_disconnect_by_func (connection, G_CALLBACK (default_wired_connection_removed_cb), self); -+ g_signal_handlers_disconnect_by_func (connection, G_CALLBACK (default_wired_connection_dbus_updated_cb), self); - -- g_object_set_data (G_OBJECT (nm_default_wired_connection_get_device (wired)), -- DEFAULT_WIRED_TAG, -- NULL); -- nm_log_info (LOGD_SETTINGS, "Saved default wired connection '%s' to persistent storage", id); -- } else { -- nm_log_warn (LOGD_SETTINGS, "couldn't save default wired connection '%s': %d / %s", -- id, -- error ? error->code : -1, -- (error && error->message) ? error->message : "(unknown)"); -- g_clear_error (&error); -- -- /* If there was an error, don't destroy the default wired connection, -- * but add it back to the system settings service. Connection is already -- * exported on the bus, don't export it again, thus do_export == FALSE. -- */ -- claim_connection (self, NM_SETTINGS_CONNECTION (wired), FALSE); -- } -- -- g_object_unref (wired); -+ if (add_to_no_auto_default) -+ nm_config_set_ethernet_no_auto_default (NM_SETTINGS_GET_PRIVATE (self)->config, NM_CONFIG_DEVICE (device)); - } - - void - nm_settings_device_added (NMSettings *self, NMDevice *device) - { - NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE (self); -- NMDefaultWiredConnection *wired; -- gboolean read_only = TRUE; -- const char *id; -- char *defname; -+ NMConnection *connection; -+ NMSettingsConnection *added; -+ NMSetting *setting; -+ GError *error = NULL; -+ const guint8 *hw_address; -+ char *defname, *uuid; -+ guint len = 0; -+ GByteArray *mac; - - if (!NM_IS_DEVICE_ETHERNET (device)) - return; - - /* If the device isn't managed or it already has a default wired connection, - * ignore it. - */ - if ( !nm_device_get_managed (device) -- || g_object_get_data (G_OBJECT (device), DEFAULT_WIRED_TAG) -+ || g_object_get_data (G_OBJECT (device), DEFAULT_WIRED_CONNECTION_TAG) - || have_connection_for_device (self, device) - || !nm_config_get_ethernet_can_auto_default (priv->config, NM_CONFIG_DEVICE (device))) - return; - -- if (get_plugin (self, NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_CONNECTIONS)) -- read_only = FALSE; -+ hw_address = nm_device_get_hw_address (device, &len); -+ if (!hw_address) -+ return; -+ -+ connection = nm_connection_new (); -+ g_assert (connection); -+ setting = nm_setting_connection_new (); -+ g_assert (setting); -+ nm_connection_add_setting (connection, setting); - - defname = nm_settings_utils_get_default_wired_name (priv->connections); -- wired = nm_default_wired_connection_new (device, defname, read_only); -+ uuid = nm_utils_uuid_generate (); -+ g_object_set (setting, -+ NM_SETTING_CONNECTION_ID, defname, -+ NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, -+ NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, -+ NM_SETTING_CONNECTION_UUID, uuid, -+ NM_SETTING_CONNECTION_TIMESTAMP, (guint64) time (NULL), -+ NULL); -+ g_free (uuid); - g_free (defname); -- if (!wired) -+ -+ /* Lock the connection to the device */ -+ setting = nm_setting_wired_new (); -+ nm_connection_add_setting (connection, setting); -+ -+ mac = g_byte_array_sized_new (len); -+ g_byte_array_append (mac, hw_address, len); -+ g_object_set (setting, NM_SETTING_WIRED_MAC_ADDRESS, mac, NULL); -+ g_byte_array_unref (mac); -+ -+ /* Add the connection */ -+ added = nm_settings_add_connection (self, connection, FALSE, &error); -+ g_object_unref (connection); -+ -+ if (!added) { -+ nm_log_warn (LOGD_SETTINGS, "(%s) couldn't create default wired connection: %s", -+ nm_device_get_iface (device), -+ (error && error->message) ? error->message : "(unknown)"); -+ g_clear_error (&error); - return; -+ } - -- id = nm_connection_get_id (NM_CONNECTION (wired)); -- g_assert (id); -+ g_object_set_data (G_OBJECT (added), DEFAULT_WIRED_DEVICE_TAG, device); -+ g_object_set_data (G_OBJECT (device), DEFAULT_WIRED_CONNECTION_TAG, added); - -- nm_log_info (LOGD_SETTINGS, "Added default wired connection '%s' for %s", -- id, nm_device_get_udi (device)); -+ g_signal_connect (added, NM_SETTINGS_CONNECTION_DBUS_UPDATED, -+ G_CALLBACK (default_wired_connection_dbus_updated_cb), self); -+ g_signal_connect (added, NM_SETTINGS_CONNECTION_REMOVED, -+ G_CALLBACK (default_wired_connection_removed_cb), self); - -- g_signal_connect (wired, "try-update", (GCallback) default_wired_try_update, self); -- g_signal_connect (wired, "deleted", (GCallback) default_wired_deleted, self); -- claim_connection (self, NM_SETTINGS_CONNECTION (wired), TRUE); -- g_object_unref (wired); -- -- g_object_set_data (G_OBJECT (device), DEFAULT_WIRED_TAG, wired); -+ nm_log_info (LOGD_SETTINGS, "(%s): created default wired connection '%s'", -+ nm_device_get_iface (device), -+ nm_connection_get_id (NM_CONNECTION (added))); - } - - void - nm_settings_device_removed (NMSettings *self, NMDevice *device) - { -- NMDefaultWiredConnection *connection; -+ NMSettingsConnection *connection; - -- if (!NM_IS_DEVICE_ETHERNET (device)) -- return; -- -- connection = (NMDefaultWiredConnection *) g_object_get_data (G_OBJECT (device), DEFAULT_WIRED_TAG); -- if (connection) -- remove_default_wired_connection (self, NM_SETTINGS_CONNECTION (connection), TRUE); -+ connection = g_object_get_data (G_OBJECT (device), DEFAULT_WIRED_CONNECTION_TAG); -+ if (connection) { -+ default_wired_clear_tag (self, device, connection, FALSE); -+ nm_settings_connection_delete (connection, NULL, NULL); -+ } - } - - /***************************************************************/ - - static gint - best_connection_sort (gconstpointer a, gconstpointer b, gpointer user_data) - { --- -1.8.3.1 - diff --git a/SOURCES/rh1031763-0001-policy-ignore-nameservers-when-starting-lookup-threa.patch b/SOURCES/rh1031763-0001-policy-ignore-nameservers-when-starting-lookup-threa.patch deleted file mode 100644 index ab2042d..0000000 --- a/SOURCES/rh1031763-0001-policy-ignore-nameservers-when-starting-lookup-threa.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 8d027cfe6012d001df5ba3342a3e1e75fe629088 Mon Sep 17 00:00:00 2001 -From: Dan Williams -Date: Tue, 19 Nov 2013 19:40:28 -0600 -Subject: [PATCH 1/3] policy: ignore nameservers when starting lookup thread - (rh #1031763) - -When generating connections, we won't always have DNS information. -Plus, the "best" device already has the default route, which is a -pretty good indication it should be the address we use for looking -up the hostname. ---- - src/nm-policy.c | 8 ++------ - 1 file changed, 2 insertions(+), 6 deletions(-) - -diff --git a/src/nm-policy.c b/src/nm-policy.c -index fe21d40..b9c915f 100644 ---- a/src/nm-policy.c -+++ b/src/nm-policy.c -@@ -460,17 +460,15 @@ update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6) - * bootup hostname. Start reverse DNS of the current IPv4 or IPv6 address. - */ - if (best4) { - NMIP4Config *ip4_config; - const NMPlatformIP4Address *addr4; - - ip4_config = nm_device_get_ip4_config (best4); -- if ( !ip4_config -- || (nm_ip4_config_get_num_nameservers (ip4_config) == 0) -- || (nm_ip4_config_get_num_addresses (ip4_config) == 0)) { -+ if (!ip4_config || (nm_ip4_config_get_num_addresses (ip4_config) == 0)) { - /* No valid IP4 config (!!); fall back to localhost.localdomain */ - _set_hostname (policy, NULL, "no IPv4 config"); - return; - } - - addr4 = nm_ip4_config_get_address (ip4_config, 0); - g_assert (addr4); /* checked for > 1 address above */ -@@ -478,17 +476,15 @@ update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6) - priv->lookup_addr = g_inet_address_new_from_bytes ((guint8 *) &addr4->address, - G_SOCKET_FAMILY_IPV4); - } else { - NMIP6Config *ip6_config; - const NMPlatformIP6Address *addr6; - - ip6_config = nm_device_get_ip6_config (best6); -- if ( !ip6_config -- || (nm_ip6_config_get_num_nameservers (ip6_config) == 0) -- || (nm_ip6_config_get_num_addresses (ip6_config) == 0)) { -+ if (!ip6_config || (nm_ip6_config_get_num_addresses (ip6_config) == 0)) { - /* No valid IP6 config (!!); fall back to localhost.localdomain */ - _set_hostname (policy, NULL, "no IPv6 config"); - return; - } - - addr6 = nm_ip6_config_get_address (ip6_config, 0); - g_assert (addr6); /* checked for > 1 address above */ --- -1.8.3.1 - diff --git a/SOURCES/rh1031763-0002-core-capture-DNS-configuration-from-resolv.conf-when.patch b/SOURCES/rh1031763-0002-core-capture-DNS-configuration-from-resolv.conf-when.patch deleted file mode 100644 index 4db0ad8..0000000 --- a/SOURCES/rh1031763-0002-core-capture-DNS-configuration-from-resolv.conf-when.patch +++ /dev/null @@ -1,676 +0,0 @@ -From 00009b2a238555b6777aab79b3190a8a46df56d2 Mon Sep 17 00:00:00 2001 -From: Dan Williams -Date: Tue, 19 Nov 2013 22:28:36 -0600 -Subject: [PATCH] core: capture DNS configuration from resolv.conf when - generating connections - -If the interface who's IP configuration is being captured has the default -route, then read DNS servers from resolv.conf into the NMIP[4|6]Config. ---- - .gitignore | 1 + - src/NetworkManagerUtils.c | 138 ++++++++++++++++++++++++++++ - src/NetworkManagerUtils.h | 8 ++ - src/devices/nm-device.c | 10 +- - src/nm-ip4-config.c | 13 ++- - src/nm-ip4-config.h | 2 +- - src/nm-ip6-config.c | 11 ++- - src/nm-ip6-config.h | 2 +- - src/tests/Makefile.am | 12 ++- - src/tests/test-resolvconf-capture.c | 176 ++++++++++++++++++++++++++++++++++++ - 10 files changed, 362 insertions(+), 11 deletions(-) - create mode 100644 src/tests/test-resolvconf-capture.c - -diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c -index c2cf5e7..5a5fb7f 100644 ---- a/src/NetworkManagerUtils.c -+++ b/src/NetworkManagerUtils.c -@@ -21,14 +21,15 @@ - - #include - #include - #include - #include - #include - #include -+#include - - #include "NetworkManagerUtils.h" - #include "nm-utils.h" - #include "nm-logging.h" - #include "nm-device.h" - #include "nm-setting-connection.h" - #include "nm-setting-ip4-config.h" -@@ -607,7 +608,136 @@ nm_utils_complete_generic (NMConnection *connection, - char * - nm_utils_new_vlan_name (const char *parent_iface, guint32 vlan_id) - { - /* Basically VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD */ - return g_strdup_printf ("%s.%d", parent_iface, vlan_id); - } - -+static GPtrArray * -+read_nameservers (const char *test_rc_contents) -+{ -+ GPtrArray *nameservers = NULL; -+ char *contents = NULL; -+ char **lines, **iter; -+ char *p; -+ -+ if (test_rc_contents) -+ contents = g_strdup (test_rc_contents); -+ else { -+ if (!g_file_get_contents (_PATH_RESCONF, &contents, NULL, NULL)) -+ return NULL; -+ } -+ -+ nameservers = g_ptr_array_new_full (3, g_free); -+ -+ lines = g_strsplit_set (contents, "\r\n", -1); -+ for (iter = lines; iter && *iter; iter++) { -+ if (!g_str_has_prefix (*iter, "nameserver")) -+ continue; -+ p = *iter + strlen ("nameserver"); -+ while (g_ascii_isspace (*p)) -+ p++; -+ -+ g_ptr_array_add (nameservers, g_strdup (p)); -+ } -+ -+ g_free (contents); -+ g_strfreev (lines); -+ return nameservers; -+} -+ -+#define IS_10(a) ((ntohl (a) & 0xff000000) == 0x0a000000) -+#define IS_172(a) ((ntohl (a) & 0xfff00000) == 0xac100000) -+#define IS_192(a) ((ntohl (a) & 0xffff0000) == 0xc0a80000) -+ -+/** -+ * nm_utils_capture_resolv_conf_ip4(): -+ * @addresses: array of #NMPlatformIP4Address structures -+ * @nameservers: array of guint32 -+ * @test_rc_contents: for testing; the contents of resolv.conf -+ * -+ * Reads all /etc/resolv.conf IPv4 nameservers and adds them to @nameservers, -+ * which checks to ensure that private-network nameservers are not added if -+ * @addresses does not contain an address in that private network. -+ */ -+void -+nm_utils_capture_resolv_conf_ip4 (const GArray *addresses, -+ GArray *nameservers, -+ const char *test_rc_contents) -+{ -+ GPtrArray *read_ns; -+ gboolean has_10 = FALSE, has_172 = FALSE, has_192 = FALSE; -+ guint i; -+ -+ g_return_if_fail (nameservers != NULL); -+ -+ read_ns = read_nameservers (test_rc_contents); -+ if (!read_ns) -+ return; -+ -+ for (i = 0; addresses && i < addresses->len; i++) { -+ NMPlatformIP4Address *addr = &g_array_index (addresses, NMPlatformIP4Address, i); -+ -+ if (IS_10 (addr->address)) -+ has_10 = TRUE; -+ else if (IS_172 (addr->address)) -+ has_172 = TRUE; -+ else if (IS_192 (addr->address)) -+ has_192 = TRUE; -+ } -+ -+ for (i = 0; i < read_ns->len; i++) { -+ const char *s = g_ptr_array_index (read_ns, i); -+ guint32 ns = 0; -+ -+ if (!inet_pton (AF_INET, s, (void *) &ns) || !ns) -+ continue; -+ -+ /* Ignore any private-network addresses that aren't in this -+ * interface's address space. -+ */ -+ if ( (IS_10 (ns) && !has_10) -+ || (IS_172 (ns) && !has_172) -+ || (IS_192 (ns) && !has_192)) -+ continue; -+ -+ g_array_append_val (nameservers, ns); -+ } -+ -+ g_ptr_array_unref (read_ns); -+} -+ -+/** -+ * nm_utils_capture_resolv_conf_ip6(): -+ * @addresses: array of #NMPlatformIP6Address structures -+ * @nameservers: array of struct in6_addr -+ * @test_rc_contents: for testing; the contents of resolv.conf -+ * -+ * Reads all /etc/resolv.conf IPv6 nameservers and adds them to @nameservers. -+ */ -+void -+nm_utils_capture_resolv_conf_ip6 (const GArray *addresses, -+ GArray *nameservers, -+ const char *test_rc_contents) -+{ -+ GPtrArray *read_ns; -+ guint i; -+ -+ g_return_if_fail (nameservers != NULL); -+ -+ read_ns = read_nameservers (test_rc_contents); -+ if (!read_ns) -+ return; -+ -+ for (i = 0; i < read_ns->len; i++) { -+ const char *s = g_ptr_array_index (read_ns, i); -+ struct in6_addr ns = IN6ADDR_ANY_INIT; -+ -+ if (!inet_pton (AF_INET6, s, (void *) &ns) || IN6_IS_ADDR_UNSPECIFIED (&ns)) -+ continue; -+ -+ g_array_append_val (nameservers, ns); -+ } -+ -+ g_ptr_array_unref (read_ns); -+} -+ -diff --git a/src/NetworkManagerUtils.h b/src/NetworkManagerUtils.h -index 93ec111..cd30ece 100644 ---- a/src/NetworkManagerUtils.h -+++ b/src/NetworkManagerUtils.h -@@ -80,8 +80,16 @@ void nm_utils_complete_generic (NMConnection *connection, - const GSList *existing, - const char *format, - const char *preferred, - gboolean default_enable_ipv6); - - char *nm_utils_new_vlan_name (const char *parent_iface, guint32 vlan_id); - -+void nm_utils_capture_resolv_conf_ip4 (const GArray *addresses, -+ GArray *nameservers, -+ const char *test_rc_contents); -+ -+void nm_utils_capture_resolv_conf_ip6 (const GArray *addresses, -+ GArray *nameservers, -+ const char *test_rc_contents); -+ - #endif /* NETWORK_MANAGER_UTILS_H */ -diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c -index cc678ce..f03ecbb 100644 ---- a/src/devices/nm-device.c -+++ b/src/devices/nm-device.c -@@ -353,15 +353,15 @@ static void cp_connection_updated (NMConnectionProvider *cp, NMConnection *conne - - static const char *state_to_string (NMDeviceState state); - - static void link_changed_cb (NMPlatform *platform, int ifindex, NMPlatformLink *info, NMPlatformReason reason, NMDevice *device); - static void check_carrier (NMDevice *device); - - static void nm_device_queued_ip_config_change_clear (NMDevice *self); --static void update_ip_config (NMDevice *self, gboolean capture_dhcp); -+static void update_ip_config (NMDevice *self, gboolean initial); - static void device_ip_changed (NMPlatform *platform, int ifindex, gpointer platform_object, NMPlatformReason reason, gpointer user_data); - - static void nm_device_slave_notify_enslave (NMDevice *dev, gboolean success); - static void nm_device_slave_notify_release (NMDevice *dev, gboolean master_failed); - - static void addrconf6_start_with_link_ready (NMDevice *self); - -@@ -6493,44 +6493,44 @@ capture_lease_config (NMDevice *device, - if (out_ip6_config && strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0) { - /* FIXME: implement find_ip6_lease_config() */ - } - } - } - - static void --update_ip_config (NMDevice *self, gboolean capture_dhcp) -+update_ip_config (NMDevice *self, gboolean initial) - { - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - int ifindex; - gboolean linklocal6_just_completed = FALSE; - - ifindex = nm_device_get_ip_ifindex (self); - if (!ifindex) - return; - - /* IPv4 */ - g_clear_object (&priv->ext_ip4_config); -- priv->ext_ip4_config = nm_ip4_config_capture (ifindex); -+ priv->ext_ip4_config = nm_ip4_config_capture (ifindex, initial); - - if (priv->ext_ip4_config) { -- if (capture_dhcp) { -+ if (initial) { - g_clear_object (&priv->dev_ip4_config); - capture_lease_config (self, priv->ext_ip4_config, &priv->dev_ip4_config, NULL, NULL); - } - if (priv->dev_ip4_config) - nm_ip4_config_subtract (priv->ext_ip4_config, priv->dev_ip4_config); - if (priv->vpn4_config) - nm_ip4_config_subtract (priv->ext_ip4_config, priv->vpn4_config); - - ip4_config_merge_and_apply (self, NULL, FALSE, NULL); - } - - /* IPv6 */ - g_clear_object (&priv->ext_ip6_config); -- priv->ext_ip6_config = nm_ip6_config_capture (ifindex); -+ priv->ext_ip6_config = nm_ip6_config_capture (ifindex, initial); - if (priv->ext_ip6_config) { - - /* Check this before modifying ext_ip6_config */ - linklocal6_just_completed = priv->linklocal6_timeout_id && - linklocal6_config_is_ready (priv->ext_ip6_config); - - if (priv->ac_ip6_config) -diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c -index 5229ef9..e27a557 100644 ---- a/src/nm-ip4-config.c -+++ b/src/nm-ip4-config.c -@@ -25,14 +25,15 @@ - - #include "libgsystem.h" - #include "nm-platform.h" - #include "nm-utils.h" - #include "nm-dbus-manager.h" - #include "nm-dbus-glib-types.h" - #include "nm-ip4-config-glue.h" -+#include "NetworkManagerUtils.h" - - - G_DEFINE_TYPE (NMIP4Config, nm_ip4_config, G_TYPE_OBJECT) - - #define NM_IP4_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IP4_CONFIG, NMIP4ConfigPrivate)) - - typedef struct { -@@ -121,20 +122,20 @@ static gboolean - routes_are_duplicate (const NMPlatformIP4Route *a, const NMPlatformIP4Route *b, gboolean consider_gateway_and_metric) - { - return a->network == b->network && a->plen == b->plen && - (!consider_gateway_and_metric || (a->gateway == b->gateway && a->metric == b->metric)); - } - - NMIP4Config * --nm_ip4_config_capture (int ifindex) -+nm_ip4_config_capture (int ifindex, gboolean capture_resolv_conf) - { - NMIP4Config *config; - NMIP4ConfigPrivate *priv; -- guint i; - gboolean gateway_changed = FALSE; -+ guint i; - - /* Slaves have no IP configuration */ - if (nm_platform_link_get_master (ifindex) > 0) - return NULL; - - config = nm_ip4_config_new (); - priv = NM_IP4_CONFIG_GET_PRIVATE (config); -@@ -156,14 +157,22 @@ nm_ip4_config_capture (int ifindex) - } - /* Remove the default route from the list */ - g_array_remove_index (priv->routes, i); - break; - } - } - -+ /* If the interface has the default route, and has IPv4 addresses, capture -+ * nameservers from /etc/resolv.conf. -+ */ -+ if (priv->addresses->len && priv->gateway && capture_resolv_conf) { -+ nm_utils_capture_resolv_conf_ip4 (priv->addresses, priv->nameservers, NULL); -+ _NOTIFY (config, PROP_NAMESERVERS); -+ } -+ - /* actually, nobody should be connected to the signal, just to be sure, notify */ - _NOTIFY (config, PROP_ADDRESSES); - _NOTIFY (config, PROP_ROUTES); - if (gateway_changed) - _NOTIFY (config, PROP_GATEWAY); - - return config; -diff --git a/src/nm-ip4-config.h b/src/nm-ip4-config.h -index 3b2b250..4ecfb76 100644 ---- a/src/nm-ip4-config.h -+++ b/src/nm-ip4-config.h -@@ -55,15 +55,15 @@ GType nm_ip4_config_get_type (void); - NMIP4Config * nm_ip4_config_new (void); - - /* D-Bus integration */ - void nm_ip4_config_export (NMIP4Config *config); - const char * nm_ip4_config_get_dbus_path (const NMIP4Config *config); - - /* Integration with nm-platform and nm-setting */ --NMIP4Config *nm_ip4_config_capture (int ifindex); -+NMIP4Config *nm_ip4_config_capture (int ifindex, gboolean capture_resolv_conf); - gboolean nm_ip4_config_commit (const NMIP4Config *config, int ifindex, int priority); - void nm_ip4_config_merge_setting (NMIP4Config *config, NMSettingIP4Config *setting); - void nm_ip4_config_update_setting (const NMIP4Config *config, NMSettingIP4Config *setting); - - /* Utility functions */ - void nm_ip4_config_merge (NMIP4Config *dst, const NMIP4Config *src); - void nm_ip4_config_subtract (NMIP4Config *dst, const NMIP4Config *src); -diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c -index 7522164..726e658 100644 ---- a/src/nm-ip6-config.c -+++ b/src/nm-ip6-config.c -@@ -26,14 +26,15 @@ - #include "nm-glib-compat.h" - #include "libgsystem.h" - #include "nm-platform.h" - #include "nm-utils.h" - #include "nm-dbus-manager.h" - #include "nm-dbus-glib-types.h" - #include "nm-ip6-config-glue.h" -+#include "NetworkManagerUtils.h" - - G_DEFINE_TYPE (NMIP6Config, nm_ip6_config, G_TYPE_OBJECT) - - #define NM_IP6_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IP6_CONFIG, NMIP6ConfigPrivate)) - - typedef struct { - char *path; -@@ -121,15 +122,15 @@ static gboolean - routes_are_duplicate (const NMPlatformIP6Route *a, const NMPlatformIP6Route *b, gboolean consider_gateway_and_metric) - { - return IN6_ARE_ADDR_EQUAL (&a->network, &b->network) && a->plen == b->plen && - (!consider_gateway_and_metric || (IN6_ARE_ADDR_EQUAL (&a->gateway, &b->gateway) && a->metric == b->metric)); - } - - NMIP6Config * --nm_ip6_config_capture (int ifindex) -+nm_ip6_config_capture (int ifindex, gboolean capture_resolv_conf) - { - NMIP6Config *config; - NMIP6ConfigPrivate *priv; - guint i; - gboolean gateway_changed = FALSE; - - /* Slaves have no IP configuration */ -@@ -156,14 +157,22 @@ nm_ip6_config_capture (int ifindex) - } - /* Remove the default route from the list */ - g_array_remove_index (priv->routes, i); - break; - } - } - -+ /* If the interface has the default route, and has IPv4 addresses, capture -+ * nameservers from /etc/resolv.conf. -+ */ -+ if (priv->addresses->len && !IN6_IS_ADDR_UNSPECIFIED (&priv->gateway) && capture_resolv_conf) { -+ nm_utils_capture_resolv_conf_ip6 (priv->addresses, priv->nameservers, NULL); -+ _NOTIFY (config, PROP_NAMESERVERS); -+ } -+ - /* actually, nobody should be connected to the signal, just to be sure, notify */ - _NOTIFY (config, PROP_ADDRESSES); - _NOTIFY (config, PROP_ROUTES); - if (gateway_changed) - _NOTIFY (config, PROP_GATEWAY); - - return config; -diff --git a/src/nm-ip6-config.h b/src/nm-ip6-config.h -index 538490a..2b1ba8b 100644 ---- a/src/nm-ip6-config.h -+++ b/src/nm-ip6-config.h -@@ -54,15 +54,15 @@ GType nm_ip6_config_get_type (void); - NMIP6Config * nm_ip6_config_new (void); - - /* D-Bus integration */ - void nm_ip6_config_export (NMIP6Config *config); - const char * nm_ip6_config_get_dbus_path (const NMIP6Config *config); - - /* Integration with nm-platform and nm-setting */ --NMIP6Config *nm_ip6_config_capture (int ifindex); -+NMIP6Config *nm_ip6_config_capture (int ifindex, gboolean initial); - gboolean nm_ip6_config_commit (const NMIP6Config *config, int ifindex, int priority); - void nm_ip6_config_merge_setting (NMIP6Config *config, NMSettingIP6Config *setting); - void nm_ip6_config_update_setting (const NMIP6Config *config, NMSettingIP6Config *setting); - - /* Utility functions */ - void nm_ip6_config_merge (NMIP6Config *dst, const NMIP6Config *src); - void nm_ip6_config_subtract (NMIP6Config *dst, const NMIP6Config *src); -diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am -index 9d17e9a..eaa9d51 100644 ---- a/src/tests/Makefile.am -+++ b/src/tests/Makefile.am -@@ -12,15 +12,16 @@ AM_CPPFLAGS = \ - - noinst_PROGRAMS = \ - test-dhcp-options \ - test-policy-hosts \ - test-wifi-ap-utils \ - test-ip4-config \ - test-ip6-config \ -- test-dcb -+ test-dcb \ -+ test-resolvconf-capture - - ####### DHCP options test ####### - - test_dhcp_options_SOURCES = \ - test-dhcp-options.c - - test_dhcp_options_CPPFLAGS = \ -@@ -67,21 +68,30 @@ test_ip6_config_LDADD = \ - - test_dcb_SOURCES = \ - test-dcb.c - - test_dcb_LDADD = \ - $(top_builddir)/src/libNetworkManager.la - -+####### resolv.conf capture test ####### -+ -+test_resolvconf_capture_SOURCES = \ -+ test-resolvconf-capture.c -+ -+test_resolvconf_capture_LDADD = \ -+ $(top_builddir)/src/libNetworkManager.la -+ - ####### secret agent interface test ####### - - EXTRA_DIST = test-secret-agent.py - - ########################################### - - check-local: test-dhcp-options test-policy-hosts test-wifi-ap-utils test-ip4-config test-ip6-config - $(abs_builddir)/test-dhcp-options - $(abs_builddir)/test-policy-hosts - $(abs_builddir)/test-wifi-ap-utils - $(abs_builddir)/test-ip4-config - $(abs_builddir)/test-ip6-config - $(abs_builddir)/test-dcb -+ $(abs_builddir)/test-resolvconf-capture - -diff --git a/src/tests/test-resolvconf-capture.c b/src/tests/test-resolvconf-capture.c -new file mode 100644 -index 0000000..0343d17 ---- /dev/null -+++ b/src/tests/test-resolvconf-capture.c -@@ -0,0 +1,176 @@ -+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -+/* -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License along -+ * with this program; if not, write to the Free Software Foundation, Inc., -+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Copyright (C) 2013 Red Hat, Inc. -+ * -+ */ -+ -+#include -+#include -+ -+#include "NetworkManagerUtils.h" -+#include "nm-platform.h" -+ -+static void -+test_capture_empty (void) -+{ -+ GArray *ns4 = g_array_new (FALSE, FALSE, sizeof (guint32)); -+ GArray *ns6 = g_array_new (FALSE, FALSE, sizeof (struct in6_addr)); -+ -+ nm_utils_capture_resolv_conf_ip4 (NULL, ns4, ""); -+ g_assert_cmpint (ns4->len, ==, 0); -+ -+ nm_utils_capture_resolv_conf_ip6 (NULL, ns6, ""); -+ g_assert_cmpint (ns6->len, ==, 0); -+ -+ g_array_free (ns4, TRUE); -+ g_array_free (ns6, TRUE); -+} -+ -+static void -+assert_dns4_entry (const GArray *a, guint i, const char *s) -+{ -+ guint32 n, m; -+ -+ g_assert (inet_aton (s, (void *) &n) != 0); -+ m = g_array_index (a, guint32, i); -+ g_assert_cmpint (m, ==, n); -+} -+ -+static void -+assert_dns6_entry (const GArray *a, guint i, const char *s) -+{ -+ struct in6_addr n = IN6ADDR_ANY_INIT; -+ struct in6_addr *m; -+ -+ g_assert (inet_pton (AF_INET6, s, (void *) &n) == 1); -+ m = &g_array_index (a, struct in6_addr, i); -+ g_assert (IN6_ARE_ADDR_EQUAL (&n, m)); -+} -+ -+static void -+test_capture_basic4 (void) -+{ -+ GArray *ns4 = g_array_new (FALSE, FALSE, sizeof (guint32)); -+ const char *rc = -+"# neato resolv.conf\r\n" -+"domain foobar.com\r\n" -+"search foobar.com\r\n" -+"nameserver 4.2.2.1\r\n" -+"nameserver 4.2.2.2\r\n" -+"nameserver 192.168.1.1\r\n"; -+ -+ nm_utils_capture_resolv_conf_ip4 (NULL, ns4, rc); -+ g_assert_cmpint (ns4->len, ==, 2); -+ assert_dns4_entry (ns4, 0, "4.2.2.1"); -+ assert_dns4_entry (ns4, 1, "4.2.2.2"); -+ /* 192.x not present because no addresses given */ -+ -+ g_array_free (ns4, TRUE); -+} -+ -+static void -+test_capture_basic6 (void) -+{ -+ GArray *ns6 = g_array_new (FALSE, FALSE, sizeof (struct in6_addr)); -+ const char *rc = -+"# neato resolv.conf\r\n" -+"domain foobar.com\r\n" -+"search foobar.com\r\n" -+"nameserver 2001:4860:4860::8888\r\n" -+"nameserver 2001:4860:4860::8844\r\n"; -+ -+ nm_utils_capture_resolv_conf_ip6 (NULL, ns6, rc); -+ g_assert_cmpint (ns6->len, ==, 2); -+ assert_dns6_entry (ns6, 0, "2001:4860:4860::8888"); -+ assert_dns6_entry (ns6, 1, "2001:4860:4860::8844"); -+ -+ g_array_free (ns6, TRUE); -+} -+ -+static void -+test_capture_private_net4 (void) -+{ -+ GArray *ns4 = g_array_new (FALSE, FALSE, sizeof (guint32)); -+ const char *rc = -+"# neato resolv.conf\r\n" -+"domain foobar.com\r\n" -+"search foobar.com\r\n" -+"nameserver 4.2.2.1\r\n" -+"nameserver 4.2.2.2\r\n" -+"nameserver 10.2.3.4\r\n" -+"nameserver 172.17.6.3\r\n" -+"nameserver 192.168.1.1\r\n"; -+ GArray *addrs = g_array_new (FALSE, FALSE, sizeof (NMPlatformIP4Address)); -+ NMPlatformIP4Address a, *b; -+ -+ memset (&a, 0, sizeof (a)); -+ a.address = htonl (0x0a000006); -+ a.plen = 8; -+ g_array_append_val (addrs, a); -+ -+ /* 10.x test */ -+ nm_utils_capture_resolv_conf_ip4 (addrs, ns4, rc); -+ g_assert_cmpint (ns4->len, ==, 3); -+ assert_dns4_entry (ns4, 0, "4.2.2.1"); -+ assert_dns4_entry (ns4, 1, "4.2.2.2"); -+ assert_dns4_entry (ns4, 2, "10.2.3.4"); -+ -+ /* 172.x test */ -+ b = &g_array_index (addrs, NMPlatformIP4Address, 0); -+ b->address = htonl (0xac100003); -+ -+ g_array_set_size (ns4, 0); -+ nm_utils_capture_resolv_conf_ip4 (addrs, ns4, rc); -+ g_assert_cmpint (ns4->len, ==, 3); -+ assert_dns4_entry (ns4, 0, "4.2.2.1"); -+ assert_dns4_entry (ns4, 1, "4.2.2.2"); -+ assert_dns4_entry (ns4, 2, "172.17.6.3"); -+ -+ /* 192.x test */ -+ b = &g_array_index (addrs, NMPlatformIP4Address, 0); -+ b->address = htonl (0xc0a80010); -+ -+ g_array_set_size (ns4, 0); -+ nm_utils_capture_resolv_conf_ip4 (addrs, ns4, rc); -+ g_assert_cmpint (ns4->len, ==, 3); -+ assert_dns4_entry (ns4, 0, "4.2.2.1"); -+ assert_dns4_entry (ns4, 1, "4.2.2.2"); -+ assert_dns4_entry (ns4, 2, "192.168.1.1"); -+ -+ g_array_free (ns4, TRUE); -+ g_array_free (addrs, TRUE); -+} -+ -+/*******************************************/ -+ -+int -+main (int argc, char **argv) -+{ -+ g_test_init (&argc, &argv, NULL); -+ -+#if !GLIB_CHECK_VERSION (2,36,0) -+ g_type_init (); -+#endif -+ -+ g_test_add_func ("/resolvconf-capture/empty", test_capture_empty); -+ g_test_add_func ("/resolvconf-capture/basic4", test_capture_basic4); -+ g_test_add_func ("/resolvconf-capture/basic6", test_capture_basic6); -+ g_test_add_func ("/resolvconf-capture/private-net4", test_capture_private_net4); -+ -+ return g_test_run (); -+} -+ --- -1.8.3.1 - diff --git a/SOURCES/rh1031763-0003-core-don-t-leave-additional-default-routes-in-captur.patch b/SOURCES/rh1031763-0003-core-don-t-leave-additional-default-routes-in-captur.patch deleted file mode 100644 index c960c56..0000000 --- a/SOURCES/rh1031763-0003-core-don-t-leave-additional-default-routes-in-captur.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 05a82a948877c62fb624c3b681fa95c9f26c26e4 Mon Sep 17 00:00:00 2001 -From: Dan Williams -Date: Tue, 19 Nov 2013 22:51:29 -0600 -Subject: [PATCH 3/3] core: don't leave additional default routes in captured - IP config - -There can be multiple defualt routes for an interface with different -metrics. Only accept the first one, otherwise the rest get left in -the IPv4 config and could be applied at random times. ---- - src/nm-ip4-config.c | 4 ++-- - src/nm-ip6-config.c | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c -index e27a557..aa4bfd5 100644 ---- a/src/nm-ip4-config.c -+++ b/src/nm-ip4-config.c -@@ -147,21 +147,21 @@ nm_ip4_config_capture (int ifindex, gboolean capture_resolv_conf) - priv->routes = nm_platform_ip4_route_get_all (ifindex, TRUE); - - /* Extract gateway from default route */ - for (i = 0; i < priv->routes->len; i++) { - const NMPlatformIP4Route *route = &g_array_index (priv->routes, NMPlatformIP4Route, i); - - if (route->network == 0) { -- if (priv->gateway != route->gateway) { -+ if (!gateway_changed && (priv->gateway != route->gateway)) { - priv->gateway = route->gateway; - gateway_changed = TRUE; - } - /* Remove the default route from the list */ - g_array_remove_index (priv->routes, i); -- break; -+ i--; - } - } - - /* If the interface has the default route, and has IPv4 addresses, capture - * nameservers from /etc/resolv.conf. - */ - if (priv->addresses->len && priv->gateway && capture_resolv_conf) { -diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c -index 726e658..08ac43a 100644 ---- a/src/nm-ip6-config.c -+++ b/src/nm-ip6-config.c -@@ -147,21 +147,21 @@ nm_ip6_config_capture (int ifindex, gboolean capture_resolv_conf) - priv->routes = nm_platform_ip6_route_get_all (ifindex, TRUE); - - /* Extract gateway from default route */ - for (i = 0; i < priv->routes->len; i++) { - const NMPlatformIP6Route *route = &g_array_index (priv->routes, NMPlatformIP6Route, i); - - if (IN6_IS_ADDR_UNSPECIFIED (&route->network)) { -- if (!IN6_ARE_ADDR_EQUAL (&priv->gateway, &route->gateway)) { -+ if (!gateway_changed && !IN6_ARE_ADDR_EQUAL (&priv->gateway, &route->gateway)) { - priv->gateway = route->gateway; - gateway_changed = TRUE; - } - /* Remove the default route from the list */ - g_array_remove_index (priv->routes, i); -- break; -+ i--; - } - } - - /* If the interface has the default route, and has IPv4 addresses, capture - * nameservers from /etc/resolv.conf. - */ - if (priv->addresses->len && !IN6_IS_ADDR_UNSPECIFIED (&priv->gateway) && capture_resolv_conf) { --- -1.8.3.1 - diff --git a/SOURCES/rh1031794-no-touch-loopback.patch b/SOURCES/rh1031794-no-touch-loopback.patch deleted file mode 100644 index fd9803f..0000000 --- a/SOURCES/rh1031794-no-touch-loopback.patch +++ /dev/null @@ -1,160 +0,0 @@ -From 46a7760ead2841d0a8ad5468bae8042b44af7aa2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Wed, 20 Nov 2013 18:05:01 +0100 -Subject: [PATCH 1/2] core: do not generate a connection for loopback interface - (rh #1032594) - -Else loopback is managed, and could be easily disconnected, which causes various -issues with applications. So do not manage it for now, to be on the safer side. - -https://bugzilla.redhat.com/show_bug.cgi?id=1032594 ---- - src/nm-manager.c | 19 ++++++++++--------- - 1 file changed, 10 insertions(+), 9 deletions(-) - -diff --git a/src/nm-manager.c b/src/nm-manager.c -index bf03084..adb8d72 100644 ---- a/src/nm-manager.c -+++ b/src/nm-manager.c -@@ -147,15 +147,15 @@ static void bluez_manager_bdaddr_added_cb (NMBluezManager *bluez_mgr, - NMManager *manager); - - static void bluez_manager_bdaddr_removed_cb (NMBluezManager *bluez_mgr, - const char *bdaddr, - const char *object_path, - gpointer user_data); - --static void add_device (NMManager *self, NMDevice *device, gboolean nm_created); -+static void add_device (NMManager *self, NMDevice *device, gboolean generate_con); - static void remove_device (NMManager *self, NMDevice *device, gboolean quitting); - - static void hostname_provider_init (NMHostnameProvider *provider_class); - - static NMActiveConnection *_new_active_connection (NMManager *self, - NMConnection *connection, - const char *specific_object, -@@ -577,15 +577,15 @@ modem_added (NMModemManager *modem_manager, - nm_log_info (LOGD_MB, "ignoring modem '%s' (no associated Bluetooth device)", modem_iface); - return; - } - - /* Make the new modem device */ - device = nm_device_modem_new (modem, driver); - if (device) -- add_device (self, device, TRUE); -+ add_device (self, device, FALSE); - } - - static void - set_state (NMManager *manager, NMState state) - { - NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); - const char *state_str; -@@ -1184,15 +1184,15 @@ system_create_virtual_device (NMManager *self, NMConnection *connection) - device = nm_device_vlan_new_for_connection (connection, parent); - } else if (nm_connection_is_type (connection, NM_SETTING_INFINIBAND_SETTING_NAME)) { - device = nm_device_infiniband_new_partition (connection, parent); - } - - if (device) { - nm_device_set_is_nm_owned (device, TRUE); -- add_device (self, device, TRUE); -+ add_device (self, device, FALSE); - } - - g_signal_handlers_unblock_by_func (nm_platform_get (), G_CALLBACK (platform_link_added_cb), self); - - out: - g_free (iface); - return device; -@@ -1765,15 +1765,15 @@ get_existing_connection (NMManager *manager, NMDevice *device) - } - g_object_unref (connection); - - return added ? NM_CONNECTION (added) : NULL; - } - - static void --add_device (NMManager *self, NMDevice *device, gboolean nm_created) -+add_device (NMManager *self, NMDevice *device, gboolean generate_con) - { - NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); - const char *iface, *driver, *type_desc; - char *path; - static guint32 devcount = 0; - const GSList *unmanaged_specs; - NMConnection *connection = NULL; -@@ -1858,16 +1858,17 @@ add_device (NMManager *self, NMDevice *device, gboolean nm_created) - - path = g_strdup_printf ("/org/freedesktop/NetworkManager/Devices/%d", devcount++); - nm_device_set_path (device, path); - nm_dbus_manager_register_object (priv->dbus_mgr, path, device); - nm_log_info (LOGD_CORE, "(%s): exported as %s", iface, path); - g_free (path); - -- /* Don't bother generating a connection for devices NM just created */ -- if (!nm_created) -+ /* Don't generate a connection e.g. for devices NM just created, or -+ * for the loopback */ -+ if (generate_con) - connection = get_existing_connection (self, device); - - /* Start the device if it's supposed to be managed */ - unmanaged_specs = nm_settings_get_unmanaged_specs (priv->settings); - if ( !manager_sleeping (self) - && !nm_device_spec_match_list (device, unmanaged_specs)) { - nm_device_set_manager_managed (device, -@@ -1959,15 +1960,15 @@ bluez_manager_bdaddr_added_cb (NMBluezManager *bluez_mgr, - nm_log_info (LOGD_HW, "BT device %s (%s) added (%s%s%s)", - name, - bdaddr, - has_dun ? "DUN" : "", - has_dun && has_nap ? " " : "", - has_nap ? "NAP" : ""); - -- add_device (manager, device, TRUE); -+ add_device (manager, device, FALSE); - } - } - - static void - bluez_manager_bdaddr_removed_cb (NMBluezManager *bluez_mgr, - const char *bdaddr, - const char *object_path, -@@ -2259,15 +2260,15 @@ platform_link_added_cb (NMPlatform *platform, - default: - device = nm_device_generic_new (plink); - break; - } - } - - if (device) -- add_device (self, device, FALSE); -+ add_device (self, device, plink->type != NM_LINK_TYPE_LOOPBACK); - } - - static void - platform_link_removed_cb (NMPlatform *platform, - int ifindex, - NMPlatformLink *plink, - NMPlatformReason reason, -@@ -2296,15 +2297,15 @@ atm_device_added_cb (NMAtmManager *atm_mgr, - - device = find_device_by_iface (self, iface); - if (device) - return; - - device = nm_device_adsl_new (sysfs_path, iface, driver); - if (device) -- add_device (self, device, FALSE); -+ add_device (self, device, TRUE); - } - - static void - atm_device_removed_cb (NMAtmManager *manager, - const char *iface, - gpointer user_data) - { --- -1.8.3.1 - diff --git a/SOURCES/rh1067170-alias-fix.patch b/SOURCES/rh1067170-alias-fix.patch new file mode 100644 index 0000000..cc7cc2b --- /dev/null +++ b/SOURCES/rh1067170-alias-fix.patch @@ -0,0 +1,70 @@ +From 736d0a4a401b3919cd5215908e166cd84798f8e2 Mon Sep 17 00:00:00 2001 +From: Dan Winship +Date: Tue, 1 Apr 2014 15:05:29 -0400 +Subject: [PATCH] ifcfg-rh: fix bugs in the new alias code (rh #1067170) + +Fix a bug when reading an invalid alias file, where the code meant to +skip the rest of the loop iteration, but failed. + +Also fix a memory leak and remove an unused variable. + +Bugs noticed by coverity. +--- + src/settings/plugins/ifcfg-rh/reader.c | 16 ++++++++++------ + src/settings/plugins/ifcfg-rh/writer.c | 3 +-- + 2 files changed, 11 insertions(+), 8 deletions(-) + +diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c +index 65142b9..70e58e9 100644 +--- a/src/settings/plugins/ifcfg-rh/reader.c ++++ b/src/settings/plugins/ifcfg-rh/reader.c +@@ -1381,8 +1381,10 @@ make_ip4_setting (shvarFile *ifcfg, + NMIP4Address *addr = NULL; + + addr = nm_ip4_address_new (); +- if (!read_full_ip4_address (ifcfg, network_file, i, addr, error)) ++ if (!read_full_ip4_address (ifcfg, network_file, i, addr, error)) { ++ nm_ip4_address_unref (addr); + goto done; ++ } + if (!nm_ip4_address_get_address (addr)) { + nm_ip4_address_unref (addr); + +@@ -1551,11 +1553,13 @@ read_aliases (NMSettingIP4Config *s_ip4, const char *filename, const char *netwo + p = strchr (item, ':'); + g_assert (p != NULL); /* we know this is true from utils_is_ifcfg_alias_file() */ + for (p++; *p; p++) { +- if (!g_ascii_isalnum (*p) && *p != '_') { +- PLUGIN_WARN (IFCFG_PLUGIN_NAME, " alias: ignoring alias file '%s' with invalid name", full_path); +- g_free (full_path); +- continue; +- } ++ if (!g_ascii_isalnum (*p) && *p != '_') ++ break; ++ } ++ if (*p) { ++ PLUGIN_WARN (IFCFG_PLUGIN_NAME, " alias: ignoring alias file '%s' with invalid name", full_path); ++ g_free (full_path); ++ continue; + } + + parsed = svNewFile (full_path); +diff --git a/src/settings/plugins/ifcfg-rh/writer.c b/src/settings/plugins/ifcfg-rh/writer.c +index 720616d..5e962c5 100644 +--- a/src/settings/plugins/ifcfg-rh/writer.c ++++ b/src/settings/plugins/ifcfg-rh/writer.c +@@ -2146,10 +2146,9 @@ write_ip4_aliases (NMConnection *connection, char *base_ifcfg_path) + { + NMSettingIP4Config *s_ip4; + char *base_ifcfg_dir, *base_ifcfg_name, *base_name; +- int i, num, base_ifcfg_path_len, base_ifcfg_name_len, base_name_len; ++ int i, num, base_ifcfg_name_len, base_name_len; + GDir *dir; + +- base_ifcfg_path_len = strlen (base_ifcfg_path); + base_ifcfg_dir = g_path_get_dirname (base_ifcfg_path); + base_ifcfg_name = g_path_get_basename (base_ifcfg_path); + base_ifcfg_name_len = strlen (base_ifcfg_name); +-- +1.8.5.3 + diff --git a/SOURCES/rh1070617-ifcfg-permissions.patch b/SOURCES/rh1070617-ifcfg-permissions.patch new file mode 100644 index 0000000..e24c08b --- /dev/null +++ b/SOURCES/rh1070617-ifcfg-permissions.patch @@ -0,0 +1,26 @@ +From f091b764b51273933dc95012f28aaf848af658a5 Mon Sep 17 00:00:00 2001 +From: Dan Winship +Date: Mon, 17 Mar 2014 12:58:12 -0400 +Subject: [PATCH] ifcfg-rh: improve error message when ifcfg file can't be read + (rh #1070617) + +--- + src/settings/plugins/ifcfg-rh/reader.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c +index c1fd181..2e0cb65 100644 +--- a/src/settings/plugins/ifcfg-rh/reader.c ++++ b/src/settings/plugins/ifcfg-rh/reader.c +@@ -4985,7 +4985,7 @@ connection_from_file (const char *filename, + parsed = svNewFile (filename); + if (!parsed) { + g_set_error (error, IFCFG_PLUGIN_ERROR, 0, +- "Couldn't parse file '%s'", filename); ++ "File '%s' exists but could not be read. (Permissions error?)", filename); + return NULL; + } + +-- +1.8.5.3 + diff --git a/SOURCES/rh1070829-resolv-conf-selinux.patch b/SOURCES/rh1070829-resolv-conf-selinux.patch new file mode 100644 index 0000000..90780f8 --- /dev/null +++ b/SOURCES/rh1070829-resolv-conf-selinux.patch @@ -0,0 +1,243 @@ +From da354830da15e6bdeec3d5f36d84e4bab6b7fedf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= +Date: Tue, 25 Mar 2014 13:55:47 +0100 +Subject: [PATCH] core: build with SELinux; don't break /etc/hostname context + (rh #1070829) + +https://bugzilla.redhat.com/show_bug.cgi?id=1070829 +--- + configure.ac | 18 ++++++++++++++++++ + src/settings/plugins/ifcfg-rh/plugin.c | 29 ++++++++++++++++++++++++++++- + 2 files changed, 46 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index f13dc9a..2ca6aed 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -356,14 +356,31 @@ case $with_suspend_resume in + *) + AC_MSG_ERROR(--with-suspend-resume must be one of [upower, systemd]) + ;; + esac + AM_CONDITIONAL(SUSPEND_RESUME_UPOWER, test "x$with_suspend_resume" = "xupower") + AM_CONDITIONAL(SUSPEND_RESUME_SYSTEMD, test "x$with_suspend_resume" = "xsystemd") + ++# SELinux support ++AC_ARG_WITH(selinux, AS_HELP_STRING([--with-selinux=yes|no|auto], [Build with SELinux (default: auto)]),,[with_selinux=auto]) ++if test "$with_selinux" = "yes" -o "$with_selinux" = "auto"; then ++ PKG_CHECK_MODULES(SELINUX, libselinux, [have_selinux=yes], [have_selinux=no]) ++else ++ have_selinux=no ++fi ++if test "$with_selinux" = "yes" -a "$have_selinux" = "no"; then ++ AC_MSG_ERROR([You must have libselinux installed to build --with-selinux=yes.]) ++fi ++if test "$have_selinux" = "yes"; then ++ AC_DEFINE(HAVE_SELINUX, 1, [Define if you have SELinux support]) ++else ++ AC_DEFINE(HAVE_SELINUX, 0, [Define if you have SELinux support]) ++fi ++AM_CONDITIONAL(HAVE_SELINUX, test "${have_selinux}" = "yes") ++ + # libnl support for the linux platform + PKG_CHECK_MODULES(LIBNL, libnl-3.0 >= 3.2.8 libnl-route-3.0 libnl-genl-3.0) + AC_SUBST(LIBNL_CFLAGS) + AC_SUBST(LIBNL_LIBS) + + # uuid library + PKG_CHECK_MODULES(UUID, uuid) +@@ -844,14 +861,15 @@ if test "${enable_polkit}" = "yes"; then + echo " policykit: yes (permissive modify.system)" + else + echo " policykit: yes (restrictive modify.system)" + fi + else + echo " policykit: no" + fi ++echo " selinux: $have_selinux" + echo + + echo "Features:" + echo " wext: $ac_with_wext" + echo " wimax: $enable_wimax" + echo " ppp: $enable_ppp" + echo " modemmanager-1: $with_modem_manager_1" +diff --git a/src/settings/plugins/ifcfg-rh/plugin.c b/src/settings/plugins/ifcfg-rh/plugin.c +index 4b70813..ca92606 100644 +--- a/src/settings/plugins/ifcfg-rh/plugin.c ++++ b/src/settings/plugins/ifcfg-rh/plugin.c +@@ -23,24 +23,30 @@ + + #include + #include + #include + #include + #include + #include ++#include ++#include + + #include + #include + #include + #include + + #include + #include + #include + ++#ifdef HAVE_SELINUX ++#include ++#endif ++ + #include + + #include "common.h" + #include "nm-dbus-glib-types.h" + #include "plugin.h" + #include "nm-system-config-interface.h" + #include "nm-settings-error.h" +@@ -663,16 +669,37 @@ plugin_get_hostname (SCPluginIfcfg *plugin) + } + + static gboolean + plugin_set_hostname (SCPluginIfcfg *plugin, const char *hostname) + { + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (plugin); + shvarFile *network; ++ gboolean ret; ++#if HAVE_SELINUX ++ security_context_t se_ctx_prev, se_ctx = NULL; ++ struct stat file_stat = { .st_mode = 0 }; + +- if (!g_file_set_contents (HOSTNAME_FILE, hostname, -1, NULL)) { ++ /* Get default context for HOSTNAME_FILE and set it for fscreate */ ++ stat (HOSTNAME_FILE, &file_stat); ++ matchpathcon (HOSTNAME_FILE, file_stat.st_mode, &se_ctx); ++ matchpathcon_fini (); ++ getfscreatecon (&se_ctx_prev); ++ setfscreatecon (se_ctx); ++#endif ++ ++ ret = g_file_set_contents (HOSTNAME_FILE, hostname, -1, NULL); ++ ++#if HAVE_SELINUX ++ /* Restore previous context and cleanup */ ++ setfscreatecon (se_ctx_prev); ++ freecon (se_ctx); ++ freecon (se_ctx_prev); ++#endif ++ ++ if (!ret) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, "Could not save hostname: failed to create/open " HOSTNAME_FILE); + return FALSE; + } + + g_free (priv->hostname); + priv->hostname = g_strdup (hostname); + +-- +1.9.0 + +From a2597c08168b87f5107cff6befda8b9118015ccc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= +Date: Wed, 26 Mar 2014 16:23:54 +0100 +Subject: [PATCH] ifcfg-rh: put \n after hostname when writing it to + /etc/hostname + +--- + src/settings/plugins/ifcfg-rh/plugin.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/settings/plugins/ifcfg-rh/plugin.c b/src/settings/plugins/ifcfg-rh/plugin.c +index ca92606..317c1bf 100644 +--- a/src/settings/plugins/ifcfg-rh/plugin.c ++++ b/src/settings/plugins/ifcfg-rh/plugin.c +@@ -669,43 +669,47 @@ plugin_get_hostname (SCPluginIfcfg *plugin) + } + + static gboolean + plugin_set_hostname (SCPluginIfcfg *plugin, const char *hostname) + { + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (plugin); + shvarFile *network; ++ char *hostname_eol; + gboolean ret; + #if HAVE_SELINUX + security_context_t se_ctx_prev, se_ctx = NULL; + struct stat file_stat = { .st_mode = 0 }; + + /* Get default context for HOSTNAME_FILE and set it for fscreate */ + stat (HOSTNAME_FILE, &file_stat); + matchpathcon (HOSTNAME_FILE, file_stat.st_mode, &se_ctx); + matchpathcon_fini (); + getfscreatecon (&se_ctx_prev); + setfscreatecon (se_ctx); + #endif + +- ret = g_file_set_contents (HOSTNAME_FILE, hostname, -1, NULL); ++ hostname_eol = g_strdup_printf ("%s\n", hostname); ++ ret = g_file_set_contents (HOSTNAME_FILE, hostname_eol, -1, NULL); + + #if HAVE_SELINUX + /* Restore previous context and cleanup */ + setfscreatecon (se_ctx_prev); + freecon (se_ctx); + freecon (se_ctx_prev); + #endif + + if (!ret) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, "Could not save hostname: failed to create/open " HOSTNAME_FILE); ++ g_free (hostname_eol); + return FALSE; + } + + g_free (priv->hostname); + priv->hostname = g_strdup (hostname); ++ g_free (hostname_eol); + + /* Remove "HOSTNAME" from SC_NETWORK_FILE, if present */ + network = svNewFile (SC_NETWORK_FILE); + if (network) { + svSetValue (network, "HOSTNAME", NULL, FALSE); + svWriteFile (network, 0644); + svCloseFile (network); +-- +1.9.0 + +From e9fdfa1700845dcac3702e8869f158d068a7d8a5 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Tue, 1 Apr 2014 23:44:06 +0200 +Subject: [PATCH] ifcfg-rh: fix compile error with HAVE_SELINUX + +Related: https://bugzilla.redhat.com/show_bug.cgi?id=1070829 + +Signed-off-by: Thomas Haller +--- + src/settings/plugins/ifcfg-rh/plugin.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/settings/plugins/ifcfg-rh/plugin.c b/src/settings/plugins/ifcfg-rh/plugin.c +index 317c1bf..1f9ed47 100644 +--- a/src/settings/plugins/ifcfg-rh/plugin.c ++++ b/src/settings/plugins/ifcfg-rh/plugin.c +@@ -35,15 +35,15 @@ + #include + #include + + #include + #include + #include + +-#ifdef HAVE_SELINUX ++#if HAVE_SELINUX + #include + #endif + + #include + + #include "common.h" + #include "nm-dbus-glib-types.h" +-- +1.9.0 + diff --git a/SOURCES/rh1078720-device-removed.patch b/SOURCES/rh1078720-device-removed.patch new file mode 100644 index 0000000..a1388d6 --- /dev/null +++ b/SOURCES/rh1078720-device-removed.patch @@ -0,0 +1,37 @@ +From acb6a0d305dddccb6d73575c88aefad60faa173a Mon Sep 17 00:00:00 2001 +From: Dan Winship +Date: Thu, 27 Mar 2014 12:16:46 -0400 +Subject: [PATCH] core: update NMManager:devices before emitting + notify::devices (rh #1078720) + +NMClient's "devices" property was getting out of sync because the +daemon was emitting "notify" before actually changing the property +value. This resulted in problems with re-activating virtual devices +that had previously been deactivated in gnome-control-center and +anaconda. (And probably gnome-shell and nm-applet?) +--- + src/nm-manager.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/nm-manager.c b/src/nm-manager.c +index be2f118..48ce061 100644 +--- a/src/nm-manager.c ++++ b/src/nm-manager.c +@@ -765,12 +765,12 @@ remove_device (NMManager *manager, NMDevice *device, gboolean quitting) + g_signal_handlers_disconnect_matched (device, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, manager); + + nm_settings_device_removed (priv->settings, device, quitting); ++ priv->devices = g_slist_remove (priv->devices, device); ++ + g_signal_emit (manager, signals[DEVICE_REMOVED], 0, device); + g_object_notify (G_OBJECT (manager), NM_MANAGER_DEVICES); + g_object_unref (device); + +- priv->devices = g_slist_remove (priv->devices, device); +- + if (priv->startup) + check_if_startup_complete (manager); + } +-- +1.8.5.3 + diff --git a/SOURCES/rh1083624-master-ignore-carrier.patch b/SOURCES/rh1083624-master-ignore-carrier.patch new file mode 100644 index 0000000..95c07dc --- /dev/null +++ b/SOURCES/rh1083624-master-ignore-carrier.patch @@ -0,0 +1,43 @@ +From 0b664ad4a4dc0e8acefdf53f8a9adb12bbd0cd29 Mon Sep 17 00:00:00 2001 +From: Dan Williams +Date: Wed, 2 Apr 2014 09:15:54 -0500 +Subject: [PATCH] core: fix bug with ignore-carrier and master/slave devices + (rh #1083521) + +Even ignore-carrier devices need to be aware of carrier-up events so +they can continue DHCP when the link comes up. They just ignore all +carrier-down events. +--- + src/devices/nm-device.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index 7e2f034..0906da3 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -1004,19 +1004,17 @@ carrier_changed (NMDevice *device, gboolean carrier) + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); + + if (!nm_device_get_managed (device)) + return; + + nm_device_recheck_available_connections (device); + +- if (priv->ignore_carrier) { +- /* Ignore all carrier-off, and ignore carrier-on on connected devices */ +- if (!carrier || priv->state > NM_DEVICE_STATE_DISCONNECTED) +- return; +- } ++ /* ignore-carrier devices ignore all carrier-down events */ ++ if (priv->ignore_carrier && !carrier) ++ return; + + if (nm_device_is_master (device)) { + /* Bridge/bond/team carrier does not affect its own activation, + * but when carrier comes on, if there are slaves waiting, + * it will restart them. + */ + if (!carrier) +-- +1.9.0 + diff --git a/SOURCES/rh1084554-balance-queued-state-lock.patch b/SOURCES/rh1084554-balance-queued-state-lock.patch new file mode 100644 index 0000000..56a7aad --- /dev/null +++ b/SOURCES/rh1084554-balance-queued-state-lock.patch @@ -0,0 +1,74 @@ +From fc1351504db557b942c121b480fca661162702f7 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Fri, 4 Apr 2014 14:55:37 +0200 +Subject: [PATCH] core: fix hanging pending_action "queued state lock" + +This bug caused nm-online to hang because "startup complete" state +is never reached. Sometimes you also see this error in the logfile: + + (em1): add_pending_action (3): 'queued state lock' already added + file devices/nm-device.c: line 7178 (nm_device_add_pending_action): should not be reached + +https://bugzilla.redhat.com/show_bug.cgi?id=1084554 +https://bugzilla.redhat.com/show_bug.cgi?id=1084556 +Related: https://bugzilla.redhat.com/show_bug.cgi?id=1082045 + +Signed-off-by: Thomas Haller +--- + src/devices/nm-device.c | 22 +++++++++------------- + 1 file changed, 9 insertions(+), 13 deletions(-) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index 6f33366..817b924 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -6840,37 +6840,33 @@ nm_device_queue_state (NMDevice *self, + { + NMDevicePrivate *priv; + + g_return_if_fail (NM_IS_DEVICE (self)); + + priv = NM_DEVICE_GET_PRIVATE (self); + +- /* "lock" the pending actions so that if there was a previously +- * queued action that's about to be cleared, that doesn't drop +- * the pending actions to 0 before we add the new pending action. +- */ +- nm_device_add_pending_action (self, "queued state lock"); ++ if (priv->queued_state.id && priv->queued_state.state == state) ++ return; ++ ++ /* Add pending action for the new state before clearing the queued states, so ++ * that we don't accidently pop all pending states and reach 'startup complete' */ ++ nm_device_add_pending_action (self, queued_state_to_string (state)); + + /* We should only ever have one delayed state transition at a time */ + if (priv->queued_state.id) { +- if (priv->queued_state.state == state) +- return; + nm_log_warn (LOGD_DEVICE, "(%s): overwriting previously queued state change to %s (%s)", +- nm_device_get_iface (self), +- state_to_string (priv->queued_state.state), +- reason_to_string (priv->queued_state.reason)); ++ nm_device_get_iface (self), ++ state_to_string (priv->queued_state.state), ++ reason_to_string (priv->queued_state.reason)); + nm_device_queued_state_clear (self); + } + + priv->queued_state.state = state; + priv->queued_state.reason = reason; + priv->queued_state.id = g_idle_add (queued_set_state, self); +- nm_device_add_pending_action (self, queued_state_to_string (state)); +- +- nm_device_remove_pending_action (self, "queued state lock"); + + nm_log_dbg (LOGD_DEVICE, "(%s): queued state change to %s due to %s (id %d)", + nm_device_get_iface (self), state_to_string (state), reason_to_string (reason), + priv->queued_state.id); + } + + NMDeviceState +-- +1.9.0 + diff --git a/SOURCES/rh799241-dcb-carrier-fixes.patch b/SOURCES/rh799241-dcb-carrier-fixes.patch new file mode 100644 index 0000000..58672de --- /dev/null +++ b/SOURCES/rh799241-dcb-carrier-fixes.patch @@ -0,0 +1,832 @@ +From a9fe0d3a347c6b8af6d772a758c64ffd9580d9de Mon Sep 17 00:00:00 2001 +From: Dan Winship +Date: Wed, 2 Apr 2014 09:24:21 -0400 +Subject: [PATCH] dcb: fix -Wformat-security bugs + +--- + src/nm-dcb.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/nm-dcb.c b/src/nm-dcb.c +index 77d7b41..5e25cd8 100644 +--- a/src/nm-dcb.c ++++ b/src/nm-dcb.c +@@ -204,15 +204,15 @@ _dcb_setup (const char *iface, + g_string_append (s, " up2tc:"); + for (i = 0; i < 8; i++) { + id = nm_setting_dcb_get_priority_traffic_class (s_dcb, i); + g_assert (id < 8); + g_string_append_c (s, '0' + id); + } + +- success = do_helper (iface, DCBTOOL, run_func, user_data, error, s->str); ++ success = do_helper (iface, DCBTOOL, run_func, user_data, error, "%s", s->str); + g_string_free (s, TRUE); + if (!success) + return FALSE; + } else { + /* Ignore disable failure since lldpad <= 0.9.46 does not support disabling + * priority groups without specifying an entire PG config. + */ +@@ -238,15 +238,15 @@ _dcb_cleanup (const char *iface, + NULL + }; + const char **iter = cmds; + gboolean success = TRUE; + + /* Turn everything off and return first error we get (if any) */ + while (iter && *iter) { +- if (!do_helper (iface, DCBTOOL, run_func, user_data, success ? error : NULL, *iter)) ++ if (!do_helper (iface, DCBTOOL, run_func, user_data, success ? error : NULL, "%s", *iter)) + success = FALSE; + iter++; + } + + return success; + } + +-- +1.9.0 + +From 18fd3e45d8db3428d4840d7cb9ea1980a22ef7de Mon Sep 17 00:00:00 2001 +From: Dan Williams +Date: Thu, 27 Mar 2014 13:49:50 -0500 +Subject: [PATCH] dcb: separate DCB enable/disable and wait for carrier changes + (rh #799241) (rh #1081991) + +Non-git-master versions of lldpad refuse to touch a device that doesn't +have a carrier. And when enabling/disabling DCB, the kernel driver will +reconfigure itself and may turn carrier off for a few seconds. So we +must ensure that before enabling/disabling DCB, the carrier is already +on. Next we must ensure that *after* enabling/disabling DCB, the +carrier is back on before doing further DCB setup. + +There's a race condition between enabling/disabling DCB and receiving +the carrier event in NetworkManager that has to be handled carefully. +Because the carrier may not yet be down after the dcbtool call to +enable/disable DCB returns, we need to wait for a couple seconds for +the carrier to go down, and then again for it to come back up. +Otherwise we might see the still-on carrier, proceed with DCB setup, +and the carrier finally goes down halfway through the setup, which +will fail the operations with "DCB not enabled, link down, or DCB +not supported" errors from lldpad. +--- + src/devices/nm-device-ethernet.c | 270 ++++++++++++++++++++++++++++++++++++--- + src/nm-dcb.c | 38 ++++-- + src/nm-dcb.h | 7 + + src/tests/test-dcb.c | 27 ++-- + 4 files changed, 300 insertions(+), 42 deletions(-) + +diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c +index a6279a4..e6f091d 100644 +--- a/src/devices/nm-device-ethernet.c ++++ b/src/devices/nm-device-ethernet.c +@@ -82,14 +82,28 @@ typedef struct Supplicant { + guint iface_state_id; + + /* Timeouts and idles */ + guint iface_con_error_cb_id; + guint con_timeout_id; + } Supplicant; + ++typedef enum { ++ DCB_WAIT_UNKNOWN = 0, ++ /* Ensure carrier is up before enabling DCB */ ++ DCB_WAIT_CARRIER_PREENABLE_UP, ++ /* Wait for carrier down when device starts enabling */ ++ DCB_WAIT_CARRIER_PRECONFIG_DOWN, ++ /* Wait for carrier up when device has finished enabling */ ++ DCB_WAIT_CARRIER_PRECONFIG_UP, ++ /* Wait carrier down when device starts configuring */ ++ DCB_WAIT_CARRIER_POSTCONFIG_DOWN, ++ /* Wait carrier up when device has finished configuring */ ++ DCB_WAIT_CARRIER_POSTCONFIG_UP, ++} DcbWait; ++ + typedef struct { + guint8 perm_hw_addr[ETH_ALEN]; /* Permanent MAC address */ + guint8 initial_hw_addr[ETH_ALEN]; /* Initial MAC address (as seen when NM starts) */ + + guint32 speed; + + Supplicant supplicant; +@@ -102,14 +116,19 @@ typedef struct { + char * subchannels; /* Composite used for checking unmanaged specs */ + + /* PPPoE */ + NMPPPManager *ppp_manager; + NMIP4Config *pending_ip4_config; + gint32 last_pppoe_time; + guint pppoe_wait_id; ++ ++ /* DCB */ ++ DcbWait dcb_wait; ++ guint dcb_timeout_id; ++ guint dcb_carrier_id; + } NMDeviceEthernetPrivate; + + enum { + PROP_0, + PROP_PERM_HW_ADDRESS, + PROP_SPEED, + +@@ -1090,51 +1109,263 @@ pppoe_stage3_ip4_config_start (NMDeviceEthernet *self, NMDeviceStateReason *reas + + *reason = NM_DEVICE_STATE_REASON_PPP_START_FAILED; + } + + return ret; + } + ++/****************************************************************/ ++ ++static void ++dcb_timeout_cleanup (NMDevice *device) ++{ ++ NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); ++ ++ if (priv->dcb_timeout_id) { ++ g_source_remove (priv->dcb_timeout_id); ++ priv->dcb_timeout_id = 0; ++ } ++} ++ ++static void ++dcb_carrier_cleanup (NMDevice *device) ++{ ++ NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); ++ ++ if (priv->dcb_carrier_id) { ++ g_signal_handler_disconnect (device, priv->dcb_carrier_id); ++ priv->dcb_carrier_id = 0; ++ } ++} ++ ++static void dcb_state (NMDevice *device, gboolean timeout); ++ ++static gboolean ++dcb_carrier_timeout (gpointer user_data) ++{ ++ NMDevice *device = NM_DEVICE (user_data); ++ NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); ++ ++ g_return_val_if_fail (nm_device_get_state (device) == NM_DEVICE_STATE_CONFIG, G_SOURCE_REMOVE); ++ ++ priv->dcb_timeout_id = 0; ++ if (priv->dcb_wait != DCB_WAIT_CARRIER_POSTCONFIG_DOWN) { ++ nm_log_warn (LOGD_DCB, ++ "(%s): DCB: timed out waiting for carrier (step %d)", ++ nm_device_get_iface (device), ++ priv->dcb_wait); ++ } ++ dcb_state (device, TRUE); ++ return G_SOURCE_REMOVE; ++} ++ ++static gboolean ++dcb_configure (NMDevice *device) ++{ ++ NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); ++ NMSettingDcb *s_dcb; ++ const char *iface = nm_device_get_iface (device); ++ GError *error = NULL; ++ ++ dcb_timeout_cleanup (device); ++ ++ s_dcb = (NMSettingDcb *) device_get_setting (device, NM_TYPE_SETTING_DCB); ++ g_assert (s_dcb); ++ if (!nm_dcb_setup (iface, s_dcb, &error)) { ++ nm_log_warn (LOGD_DCB, ++ "Activation (%s/wired) failed to enable DCB/FCoE: %s", ++ iface, error->message); ++ g_clear_error (&error); ++ return FALSE; ++ } ++ ++ /* Pause again just in case the device takes the carrier down when ++ * setting specific DCB attributes. ++ */ ++ nm_log_dbg (LOGD_DCB, "(%s): waiting for carrier (postconfig down)", iface); ++ priv->dcb_wait = DCB_WAIT_CARRIER_POSTCONFIG_DOWN; ++ priv->dcb_timeout_id = g_timeout_add_seconds (3, dcb_carrier_timeout, device); ++ return TRUE; ++} ++ ++static gboolean ++dcb_enable (NMDevice *device) ++{ ++ NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); ++ const char *iface = nm_device_get_iface (device); ++ GError *error = NULL; ++ ++ dcb_timeout_cleanup (device); ++ if (!nm_dcb_enable (iface, TRUE, &error)) { ++ nm_log_warn (LOGD_DCB, ++ "Activation (%s/wired) failed to enable DCB/FCoE: %s", ++ iface, error->message); ++ g_clear_error (&error); ++ return FALSE; ++ } ++ ++ /* Pause for 3 seconds after enabling DCB to let the card reconfigure ++ * itself. Drivers will often re-initialize internal settings which ++ * takes the carrier down for 2 or more seconds. During this time, ++ * lldpad will refuse to do anything else with the card since the carrier ++ * is down. But NM might get the carrier-down signal long after calling ++ * "dcbtool dcb on", so we have to first wait for the carrier to go down. ++ */ ++ nm_log_dbg (LOGD_DCB, "(%s): waiting for carrier (preconfig down)", iface); ++ priv->dcb_wait = DCB_WAIT_CARRIER_PRECONFIG_DOWN; ++ priv->dcb_timeout_id = g_timeout_add_seconds (3, dcb_carrier_timeout, device); ++ return TRUE; ++} ++ ++static void ++dcb_state (NMDevice *device, gboolean timeout) ++{ ++ NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); ++ const char *iface = nm_device_get_iface (device); ++ gboolean carrier; ++ ++ g_return_if_fail (nm_device_get_state (device) == NM_DEVICE_STATE_CONFIG); ++ ++ ++ carrier = nm_platform_link_is_connected (nm_device_get_ifindex (device)); ++ nm_log_dbg (LOGD_DCB, "(%s): dcb_state() wait %d carrier %d timeout %d", iface, priv->dcb_wait, carrier, timeout); ++ ++ switch (priv->dcb_wait) { ++ case DCB_WAIT_CARRIER_PREENABLE_UP: ++ if (timeout || carrier) { ++ nm_log_dbg (LOGD_DCB, "(%s): dcb_state() enabling DCB", iface); ++ dcb_timeout_cleanup (device); ++ if (!dcb_enable (device)) { ++ dcb_carrier_cleanup (device); ++ nm_device_state_changed (device, ++ NM_ACT_STAGE_RETURN_FAILURE, ++ NM_DEVICE_STATE_REASON_DCB_FCOE_FAILED); ++ } ++ } ++ break; ++ case DCB_WAIT_CARRIER_PRECONFIG_DOWN: ++ dcb_timeout_cleanup (device); ++ priv->dcb_wait = DCB_WAIT_CARRIER_PRECONFIG_UP; ++ ++ if (!carrier) { ++ /* Wait for the carrier to come back up */ ++ nm_log_dbg (LOGD_DCB, "(%s): waiting for carrier (preconfig up)", iface); ++ priv->dcb_timeout_id = g_timeout_add_seconds (5, dcb_carrier_timeout, device); ++ break; ++ } ++ nm_log_dbg (LOGD_DCB, "(%s): dcb_state() preconfig down falling through", iface); ++ /* carrier never went down? fall through */ ++ case DCB_WAIT_CARRIER_PRECONFIG_UP: ++ if (timeout || carrier) { ++ nm_log_dbg (LOGD_DCB, "(%s): dcb_state() preconfig up configuring DCB", iface); ++ dcb_timeout_cleanup (device); ++ if (!dcb_configure (device)) { ++ dcb_carrier_cleanup (device); ++ nm_device_state_changed (device, ++ NM_ACT_STAGE_RETURN_FAILURE, ++ NM_DEVICE_STATE_REASON_DCB_FCOE_FAILED); ++ } ++ } ++ break; ++ case DCB_WAIT_CARRIER_POSTCONFIG_DOWN: ++ dcb_timeout_cleanup (device); ++ priv->dcb_wait = DCB_WAIT_CARRIER_POSTCONFIG_UP; ++ ++ if (!carrier) { ++ /* Wait for the carrier to come back up */ ++ nm_log_dbg (LOGD_DCB, "(%s): waiting for carrier (postconfig up)", iface); ++ priv->dcb_timeout_id = g_timeout_add_seconds (5, dcb_carrier_timeout, device); ++ break; ++ } ++ nm_log_dbg (LOGD_DCB, "(%s): dcb_state() postconfig down falling through", iface); ++ /* carrier never went down? fall through */ ++ case DCB_WAIT_CARRIER_POSTCONFIG_UP: ++ if (timeout || carrier) { ++ nm_log_dbg (LOGD_DCB, "(%s): dcb_state() postconfig up starting IP", iface); ++ dcb_timeout_cleanup (device); ++ dcb_carrier_cleanup (device); ++ priv->dcb_wait = DCB_WAIT_UNKNOWN; ++ nm_device_activate_schedule_stage3_ip_config_start (device); ++ } ++ break; ++ default: ++ g_assert_not_reached (); ++ } ++} ++ ++static void ++dcb_carrier_changed (NMDevice *device, GParamSpec *pspec, gpointer unused) ++{ ++ NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); ++ ++ g_return_if_fail (nm_device_get_state (device) == NM_DEVICE_STATE_CONFIG); ++ ++ if (priv->dcb_timeout_id) { ++ nm_log_dbg (LOGD_DCB, "(%s): carrier_changed() calling dcb_state()", nm_device_get_iface (device)); ++ dcb_state (device, FALSE); ++ } ++} ++ ++/****************************************************************/ ++ + static NMActStageReturn + act_stage2_config (NMDevice *device, NMDeviceStateReason *reason) + { ++ NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); + NMSettingConnection *s_con; + const char *connection_type; + NMActStageReturn ret = NM_ACT_STAGE_RETURN_SUCCESS; + NMSettingDcb *s_dcb; +- GError *error = NULL; + + g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); + +- /* DCB and FCoE setup */ +- s_dcb = (NMSettingDcb *) device_get_setting (device, NM_TYPE_SETTING_DCB); +- if (s_dcb) { +- if (!nm_dcb_setup (nm_device_get_iface (device), s_dcb, &error)) { +- nm_log_warn (LOGD_DEVICE | LOGD_HW, +- "Activation (%s/wired) failed to enable DCB/FCoE: %s", +- nm_device_get_iface (device), error->message); +- g_clear_error (&error); +- *reason = NM_DEVICE_STATE_REASON_DCB_FCOE_FAILED; +- return NM_ACT_STAGE_RETURN_FAILURE; +- } +- } +- + s_con = NM_SETTING_CONNECTION (device_get_setting (device, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + ++ dcb_timeout_cleanup (device); ++ dcb_carrier_cleanup (device); ++ + /* 802.1x has to run before any IP configuration since the 802.1x auth + * process opens the port up for normal traffic. + */ + connection_type = nm_setting_connection_get_connection_type (s_con); + if (!strcmp (connection_type, NM_SETTING_WIRED_SETTING_NAME)) { + NMSetting8021x *security; + + security = (NMSetting8021x *) device_get_setting (device, NM_TYPE_SETTING_802_1X); +- if (security) +- ret = nm_8021x_stage2_config (NM_DEVICE_ETHERNET (device), reason); ++ if (security) { ++ /* FIXME: for now 802.1x is mutually exclusive with DCB */ ++ return nm_8021x_stage2_config (NM_DEVICE_ETHERNET (device), reason); ++ } ++ } ++ ++ /* DCB and FCoE setup */ ++ s_dcb = (NMSettingDcb *) device_get_setting (device, NM_TYPE_SETTING_DCB); ++ if (s_dcb) { ++ /* lldpad really really wants the carrier to be up */ ++ if (nm_platform_link_is_connected (nm_device_get_ifindex (device))) { ++ if (!dcb_enable (device)) { ++ *reason = NM_DEVICE_STATE_REASON_DCB_FCOE_FAILED; ++ return NM_ACT_STAGE_RETURN_FAILURE; ++ } ++ } else { ++ nm_log_dbg (LOGD_DCB, "(%s): waiting for carrier (preenable up)", ++ nm_device_get_iface (device)); ++ priv->dcb_wait = DCB_WAIT_CARRIER_PREENABLE_UP; ++ priv->dcb_timeout_id = g_timeout_add_seconds (4, dcb_carrier_timeout, device); ++ } ++ ++ /* Watch carrier independently of NMDeviceClass::carrier_changed so ++ * we get instant notifications of disconnection that aren't deferred. ++ */ ++ priv->dcb_carrier_id = g_signal_connect (device, ++ "notify::" NM_DEVICE_CARRIER, ++ G_CALLBACK (dcb_carrier_changed), ++ NULL); ++ ret = NM_ACT_STAGE_RETURN_POSTPONE; + } + + return ret; + } + + static NMActStageReturn + act_stage3_ip4_config_start (NMDevice *device, +@@ -1202,14 +1433,18 @@ deactivate (NMDevice *device) + if (priv->ppp_manager) { + g_object_unref (priv->ppp_manager); + priv->ppp_manager = NULL; + } + + supplicant_interface_release (self); + ++ priv->dcb_wait = DCB_WAIT_UNKNOWN; ++ dcb_timeout_cleanup (device); ++ dcb_carrier_cleanup (device); ++ + /* Tear down DCB/FCoE if it was enabled */ + s_dcb = (NMSettingDcb *) device_get_setting (device, NM_TYPE_SETTING_DCB); + if (s_dcb) { + if (!nm_dcb_cleanup (nm_device_get_iface (device), &error)) { + nm_log_warn (LOGD_DEVICE | LOGD_HW, + "(%s) failed to disable DCB/FCoE: %s", + nm_device_get_iface (device), error->message); +@@ -1405,14 +1640,17 @@ dispose (GObject *object) + g_free (priv->subchannels); + + if (priv->pppoe_wait_id) { + g_source_remove (priv->pppoe_wait_id); + priv->pppoe_wait_id = 0; + } + ++ dcb_timeout_cleanup (NM_DEVICE (self)); ++ dcb_carrier_cleanup (NM_DEVICE (self)); ++ + G_OBJECT_CLASS (nm_device_ethernet_parent_class)->dispose (object); + } + + static void + get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) + { +diff --git a/src/nm-dcb.c b/src/nm-dcb.c +index 5e25cd8..428c61e 100644 +--- a/src/nm-dcb.c ++++ b/src/nm-dcb.c +@@ -88,14 +88,27 @@ out: + g_strfreev (split); + g_free (argv); + g_free (cmdline); + g_free (errmsg); + return success; + } + ++gboolean ++_dcb_enable (const char *iface, ++ gboolean enable, ++ DcbFunc run_func, ++ gpointer user_data, ++ GError **error) ++{ ++ if (enable) ++ return do_helper (iface, DCBTOOL, run_func, user_data, error, "dcb on"); ++ else ++ return do_helper (iface, DCBTOOL, run_func, user_data, error, "dcb off"); ++} ++ + #define SET_FLAGS(f, tag) \ + G_STMT_START { \ + if (!do_helper (iface, DCBTOOL, run_func, user_data, error, tag " e:%c a:%c w:%c", \ + f & NM_SETTING_DCB_FLAG_ENABLE ? '1' : '0', \ + f & NM_SETTING_DCB_FLAG_ADVERTISE ? '1' : '0', \ + f & NM_SETTING_DCB_FLAG_WILLING ? '1' : '0')) \ + return FALSE; \ +@@ -120,17 +133,14 @@ _dcb_setup (const char *iface, + GError **error) + { + NMSettingDcbFlags flags; + guint i; + + g_assert (s_dcb); + +- if (!do_helper (iface, DCBTOOL, run_func, user_data, error, "dcb on")) +- return FALSE; +- + /* FCoE */ + flags = nm_setting_dcb_get_app_fcoe_flags (s_dcb); + SET_APP (flags, s_dcb, fcoe); + + /* iSCSI */ + flags = nm_setting_dcb_get_app_iscsi_flags (s_dcb); + SET_APP (flags, s_dcb, iscsi); +@@ -225,15 +235,14 @@ _dcb_setup (const char *iface, + gboolean + _dcb_cleanup (const char *iface, + DcbFunc run_func, + gpointer user_data, + GError **error) + { + const char *cmds[] = { +- "dcb off", + "app:fcoe e:0", + "app:iscsi e:0", + "app:fip e:0", + "pfc e:0", + "pg e:0", + NULL + }; +@@ -243,14 +252,17 @@ _dcb_cleanup (const char *iface, + /* Turn everything off and return first error we get (if any) */ + while (iter && *iter) { + if (!do_helper (iface, DCBTOOL, run_func, user_data, success ? error : NULL, "%s", *iter)) + success = FALSE; + iter++; + } + ++ if (!_dcb_enable (iface, FALSE, run_func, user_data, success ? error : NULL)) ++ success = FALSE; ++ + return success; + } + + gboolean + _fcoe_setup (const char *iface, + NMSettingDcb *s_dcb, + DcbFunc run_func, +@@ -351,32 +363,32 @@ run_helper (char **argv, guint which, gpointer user_data, GError **error) + g_free (errmsg); + + g_free (cmdline); + return success; + } + + gboolean ++nm_dcb_enable (const char *iface, gboolean enable, GError **error) ++{ ++ return _dcb_enable (iface, enable, run_helper, GUINT_TO_POINTER (DCBTOOL), error); ++} ++ ++gboolean + nm_dcb_setup (const char *iface, NMSettingDcb *s_dcb, GError **error) + { + gboolean success; + + success = _dcb_setup (iface, s_dcb, run_helper, GUINT_TO_POINTER (DCBTOOL), error); + if (success) + success = _fcoe_setup (iface, s_dcb, run_helper, GUINT_TO_POINTER (FCOEADM), error); + + return success; + } + + gboolean + nm_dcb_cleanup (const char *iface, GError **error) + { +- gboolean success; +- +- success = _dcb_cleanup (iface, run_helper, GUINT_TO_POINTER (DCBTOOL), error); +- if (success) { +- /* Only report FCoE errors if DCB cleanup was successful */ +- success = _fcoe_cleanup (iface, run_helper, GUINT_TO_POINTER (FCOEADM), success ? error : NULL); +- } +- +- return success; ++ /* Ignore FCoE cleanup errors */ ++ _fcoe_cleanup (iface, run_helper, GUINT_TO_POINTER (FCOEADM), NULL); ++ return _dcb_cleanup (iface, run_helper, GUINT_TO_POINTER (DCBTOOL), error); + } + +diff --git a/src/nm-dcb.h b/src/nm-dcb.h +index 3dbd5e6..bfe5ced 100644 +--- a/src/nm-dcb.h ++++ b/src/nm-dcb.h +@@ -44,14 +44,15 @@ typedef enum { + + #define NM_DCB_ERROR (nm_dcb_error_quark ()) + GQuark nm_dcb_error_quark (void); + #define NM_TYPE_DCB_ERROR (nm_dcb_error_get_type ()) + GType nm_dcb_error_get_type (void); + + ++gboolean nm_dcb_enable (const char *iface, gboolean enable, GError **error); + gboolean nm_dcb_setup (const char *iface, NMSettingDcb *s_dcb, GError **error); + gboolean nm_dcb_cleanup (const char *iface, GError **error); + + /* For testcases only! */ + typedef gboolean (*DcbFunc) (char **argv, + guint which, + gpointer user_data, +@@ -64,14 +65,20 @@ gboolean do_helper (const char *iface, + guint which, + DcbFunc run_func, + gpointer user_data, + GError **error, + const char *fmt, + ...) G_GNUC_PRINTF(6, 7); + ++gboolean _dcb_enable (const char *iface, ++ gboolean enable, ++ DcbFunc run_func, ++ gpointer user_data, ++ GError **error); ++ + gboolean _dcb_setup (const char *iface, + NMSettingDcb *s_dcb, + DcbFunc run_func, + gpointer user_data, + GError **error); + + gboolean _dcb_cleanup (const char *iface, +diff --git a/src/tests/test-dcb.c b/src/tests/test-dcb.c +index 74dcca5..aead8f1 100644 +--- a/src/tests/test-dcb.c ++++ b/src/tests/test-dcb.c +@@ -50,16 +50,15 @@ test_dcb_func (char **argv, guint which, gpointer user_data, GError **error) + NM_SETTING_DCB_FLAG_ADVERTISE | \ + NM_SETTING_DCB_FLAG_WILLING) + + static void + test_dcb_fcoe (void) + { + static DcbExpected expected = { 0, +- { "dcbtool sc eth0 dcb on", +- "dcbtool sc eth0 app:fcoe e:1 a:1 w:1", ++ { "dcbtool sc eth0 app:fcoe e:1 a:1 w:1", + "dcbtool sc eth0 app:fcoe appcfg:40", + "dcbtool sc eth0 app:iscsi e:0 a:0 w:0", + "dcbtool sc eth0 app:fip e:0 a:0 w:0", + "dcbtool sc eth0 pfc e:0 a:0 w:0", + "dcbtool sc eth0 pg e:0", + NULL }, + }; +@@ -81,16 +80,15 @@ test_dcb_fcoe (void) + g_object_unref (s_dcb); + } + + static void + test_dcb_iscsi (void) + { + static DcbExpected expected = { 0, +- { "dcbtool sc eth0 dcb on", +- "dcbtool sc eth0 app:fcoe e:0 a:0 w:0", ++ { "dcbtool sc eth0 app:fcoe e:0 a:0 w:0", + "dcbtool sc eth0 app:iscsi e:1 a:0 w:1", + "dcbtool sc eth0 app:iscsi appcfg:08", + "dcbtool sc eth0 app:fip e:0 a:0 w:0", + "dcbtool sc eth0 pfc e:0 a:0 w:0", + "dcbtool sc eth0 pg e:0", + NULL }, + }; +@@ -112,16 +110,15 @@ test_dcb_iscsi (void) + g_object_unref (s_dcb); + } + + static void + test_dcb_fip (void) + { + static DcbExpected expected = { 0, +- { "dcbtool sc eth0 dcb on", +- "dcbtool sc eth0 app:fcoe e:0 a:0 w:0", ++ { "dcbtool sc eth0 app:fcoe e:0 a:0 w:0", + "dcbtool sc eth0 app:iscsi e:0 a:0 w:0", + "dcbtool sc eth0 app:fip e:1 a:1 w:0", + "dcbtool sc eth0 app:fip appcfg:01", + "dcbtool sc eth0 pfc e:0 a:0 w:0", + "dcbtool sc eth0 pg e:0", + NULL }, + }; +@@ -143,16 +140,15 @@ test_dcb_fip (void) + g_object_unref (s_dcb); + } + + static void + test_dcb_fip_default_prio (void) + { + static DcbExpected expected = { 0, +- { "dcbtool sc eth0 dcb on", +- "dcbtool sc eth0 app:fcoe e:0 a:0 w:0", ++ { "dcbtool sc eth0 app:fcoe e:0 a:0 w:0", + "dcbtool sc eth0 app:iscsi e:0 a:0 w:0", + "dcbtool sc eth0 app:fip e:1 a:1 w:0", + "dcbtool sc eth0 pfc e:0 a:0 w:0", + "dcbtool sc eth0 pg e:0", + NULL }, + }; + NMSettingDcb *s_dcb; +@@ -173,16 +169,15 @@ test_dcb_fip_default_prio (void) + g_object_unref (s_dcb); + } + + static void + test_dcb_pfc (void) + { + static DcbExpected expected = { 0, +- { "dcbtool sc eth0 dcb on", +- "dcbtool sc eth0 app:fcoe e:0 a:0 w:0", ++ { "dcbtool sc eth0 app:fcoe e:0 a:0 w:0", + "dcbtool sc eth0 app:iscsi e:0 a:0 w:0", + "dcbtool sc eth0 app:fip e:0 a:0 w:0", + "dcbtool sc eth0 pfc e:1 a:1 w:1", + "dcbtool sc eth0 pfc pfcup:01101100", + "dcbtool sc eth0 pg e:0", + NULL }, + }; +@@ -212,16 +207,15 @@ test_dcb_pfc (void) + g_object_unref (s_dcb); + } + + static void + test_dcb_priority_groups (void) + { + static DcbExpected expected = { 0, +- { "dcbtool sc eth0 dcb on", +- "dcbtool sc eth0 app:fcoe e:0 a:0 w:0", ++ { "dcbtool sc eth0 app:fcoe e:0 a:0 w:0", + "dcbtool sc eth0 app:iscsi e:0 a:0 w:0", + "dcbtool sc eth0 app:fip e:0 a:0 w:0", + "dcbtool sc eth0 pfc e:0 a:0 w:0", + "dcbtool sc eth0 pg e:1 a:1 w:1" \ + " pgid:765f3210" \ + " pgpct:10,40,5,10,5,20,7,3" \ + " uppct:100,50,33,25,20,16,14,12" \ +@@ -264,28 +258,35 @@ test_dcb_priority_groups (void) + g_object_unref (s_dcb); + } + + static void + test_dcb_cleanup (void) + { + static DcbExpected expected = { 0, +- { "dcbtool sc eth0 dcb off", ++ { "fcoeadm -d eth0", + "dcbtool sc eth0 app:fcoe e:0", + "dcbtool sc eth0 app:iscsi e:0", + "dcbtool sc eth0 app:fip e:0", + "dcbtool sc eth0 pfc e:0", + "dcbtool sc eth0 pg e:0", ++ "dcbtool sc eth0 dcb off", + NULL }, + }; + GError *error = NULL; + gboolean success; + ++ success = _fcoe_cleanup ("eth0", test_dcb_func, &expected, &error); ++ g_assert_no_error (error); ++ g_assert (success); ++ + success = _dcb_cleanup ("eth0", test_dcb_func, &expected, &error); + g_assert_no_error (error); + g_assert (success); ++ ++ g_assert_cmpstr (expected.cmds[expected.num], ==, NULL); + } + + static void + test_fcoe_create (void) + { + static DcbExpected expected1 = { 0, + { "fcoeadm -m fabric -c eth0", NULL }, +-- +1.9.0 + +From 55704170caed97eb26b3853af04cbbf332845966 Mon Sep 17 00:00:00 2001 +From: Dan Williams +Date: Mon, 31 Mar 2014 15:06:22 -0500 +Subject: [PATCH] dcb: wait for carrier down/up after disabling FCoE + +--- + src/nm-dcb.c | 32 ++++++++++++++++++++++++++++++++ + 1 file changed, 32 insertions(+) + +diff --git a/src/nm-dcb.c b/src/nm-dcb.c +index 428c61e..3bdbf7d 100644 +--- a/src/nm-dcb.c ++++ b/src/nm-dcb.c +@@ -380,15 +380,47 @@ nm_dcb_setup (const char *iface, NMSettingDcb *s_dcb, GError **error) + success = _dcb_setup (iface, s_dcb, run_helper, GUINT_TO_POINTER (DCBTOOL), error); + if (success) + success = _fcoe_setup (iface, s_dcb, run_helper, GUINT_TO_POINTER (FCOEADM), error); + + return success; + } + ++static void ++carrier_wait (const char *iface, guint secs, gboolean up) ++{ ++ int ifindex, count = secs * 10; ++ ++ g_return_if_fail (iface != NULL); ++ ++ ifindex = nm_platform_link_get_ifindex (iface); ++ if (ifindex > 0) { ++ /* To work around driver quirks and lldpad handling of carrier status, ++ * we must wait a short period of time to see if the carrier goes ++ * down, and then wait for the carrier to come back up again. Otherwise ++ * subsequent lldpad calls may fail with "Device not found, link down ++ * or DCB not enabled" errors. ++ */ ++ nm_log_dbg (LOGD_DCB, "(%s): cleanup waiting for carrier %s", ++ iface, up ? "up" : "down"); ++ g_usleep (G_USEC_PER_SEC / 4); ++ while (nm_platform_link_is_connected (ifindex) != up && count-- > 0) { ++ g_usleep (G_USEC_PER_SEC / 10); ++ nm_platform_link_refresh (ifindex); ++ } ++ } ++} ++ + gboolean + nm_dcb_cleanup (const char *iface, GError **error) + { + /* Ignore FCoE cleanup errors */ + _fcoe_cleanup (iface, run_helper, GUINT_TO_POINTER (FCOEADM), NULL); ++ ++ /* Must pause a bit to wait for carrier-up since disabling FCoE may ++ * cause the device to take the link down, making lldpad return errors. ++ */ ++ carrier_wait (iface, 2, FALSE); ++ carrier_wait (iface, 4, TRUE); ++ + return _dcb_cleanup (iface, run_helper, GUINT_TO_POINTER (DCBTOOL), error); + } + +-- +1.9.0 + diff --git a/SOURCES/rh997998-core-fix-re-activation-of-existing-active-connection.patch b/SOURCES/rh997998-core-fix-re-activation-of-existing-active-connection.patch deleted file mode 100644 index d6d3c1e..0000000 --- a/SOURCES/rh997998-core-fix-re-activation-of-existing-active-connection.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 3c236c88ebe396cff6ca492f1cc1cf1c30ed0e8c Mon Sep 17 00:00:00 2001 -From: Dan Winship -Date: Tue, 12 Nov 2013 14:18:44 -0500 -Subject: [PATCH] core: fix re-activation of existing active connection - -The change to allow an NMConnection to only be active on a single -device accidentally broke the case of re-activating a connection on -the same device. Fix that. ---- - src/nm-manager.c | 15 +++++++++------ - 1 file changed, 9 insertions(+), 6 deletions(-) - -diff --git a/src/nm-manager.c b/src/nm-manager.c -index 7555930..039a606 100644 ---- a/src/nm-manager.c -+++ b/src/nm-manager.c -@@ -2890,28 +2890,31 @@ _new_active_connection (NMManager *self, - NMActiveConnection *existing_ac; - - g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); - g_return_val_if_fail (NM_IS_AUTH_SUBJECT (subject), NULL); - - /* Can't create new AC for already-active connection */ - existing_ac = find_ac_for_connection (self, connection); -+ if (NM_IS_VPN_CONNECTION (existing_ac)) { -+ g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_CONNECTION_ALREADY_ACTIVE, -+ "Connection '%s' is already active", -+ nm_connection_get_id (connection)); -+ return NULL; -+ } -+ - if (existing_ac) { - NMDevice *existing_device = nm_active_connection_get_device (existing_ac); - -- if (NM_IS_VPN_CONNECTION (existing_ac) || existing_device == device) { -- g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_CONNECTION_ALREADY_ACTIVE, -- "Connection '%s' is already active", -- nm_connection_get_id (connection)); -- } else { -+ if (existing_device != device) { - g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_CONNECTION_ALREADY_ACTIVE, - "Connection '%s' is already active on %s", - nm_connection_get_id (connection), - nm_device_get_iface (existing_device)); -+ return NULL; - } -- return NULL; - } - - /* Normalize the specific object */ - if (specific_object && g_strcmp0 (specific_object, "/") == 0) - specific_object = NULL; - - if (nm_connection_is_type (connection, NM_SETTING_VPN_SETTING_NAME)) { --- -1.8.3.1 - diff --git a/SPECS/NetworkManager.spec b/SPECS/NetworkManager.spec index f8de643..738908b 100644 --- a/SPECS/NetworkManager.spec +++ b/SPECS/NetworkManager.spec @@ -2,47 +2,56 @@ %define dbus_glib_version 0.94 %define glib2_version 2.24.0 +%define wireless_tools_version 1:28-0pre9 %define libnl3_version 3.2.7 %define ppp_version 2.4.5 -%define snapshot .git20131108 -%define realversion 0.9.9.0 +%define snapshot .git20140326 +%define git_sha .4dba720 +%define realversion 0.9.9.1 -%define nmtui_version 0.0.1 +%global with_nmtui 1 %global regen_docs 0 %define systemd_dir %{_prefix}/lib/systemd/system %define udev_dir %{_prefix}/lib/udev +%if 0%{?rhel} || (0%{?fedora} > 19) +%global with_teamctl 1 +%endif + + %global _hardened_build 1 Name: NetworkManager Summary: Network connection manager and user applications Epoch: 1 -Version: 0.9.9.0 -Release: 25%{snapshot}%{?dist} +Version: %{realversion} +Release: 12%{snapshot}%{?git_sha}%{?dist} Group: System Environment/Base License: GPLv2+ URL: http://www.gnome.org/projects/NetworkManager/ -Source: %{name}-%{realversion}%{snapshot}.tar.bz2 +Source: %{name}-%{realversion}%{snapshot}%{git_sha}.tar.bz2 Source1: NetworkManager.conf Source2: 00-server.conf -Source3: nmtui-%{nmtui_version}.tar.xz -Patch1: explain-dns1-dns2.patch -Patch2: 0001-fix-build-with-newt-0.52.15.patch -Patch3: rh1029464-settings-convert-NMDefaultWiredConnection-into-a-pla.patch -Patch4: rh997998-core-fix-re-activation-of-existing-active-connection.patch - -Patch5: rh1031763-0001-policy-ignore-nameservers-when-starting-lookup-threa.patch -Patch6: rh1031763-0002-core-capture-DNS-configuration-from-resolv.conf-when.patch -Patch7: rh1031763-0003-core-don-t-leave-additional-default-routes-in-captur.patch - -Patch8: rh1031794-no-touch-loopback.patch +Source3: README.nmcs +Patch1: 0001-explain-dns1-dns2.patch +Patch2: rh1070617-ifcfg-permissions.patch +Patch3: rh1078720-device-removed.patch +Patch4: rh1067170-alias-fix.patch +Patch5: rh1070829-resolv-conf-selinux.patch +Patch6: rh799241-dcb-carrier-fixes.patch +Patch7: rh1083624-master-ignore-carrier.patch +Patch8: rh1084554-balance-queued-state-lock.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +%if 0%{?fedora} && 0%{?fedora} < 20 +Requires(post): chkconfig +Requires(preun): chkconfig +%endif Requires(post): systemd-sysv Requires(post): systemd Requires(preun): systemd @@ -72,7 +81,7 @@ Conflicts: kde-plasma-networkmanagement < 1:0.9-0.49.20110527git.nm09 BuildRequires: dbus-devel >= %{dbus_version} BuildRequires: dbus-glib-devel >= %{dbus_glib_version} %if 0%{?fedora} -BuildRequires: wireless-tools-devel >= 1:28-0pre9 +BuildRequires: wireless-tools-devel >= %{wireless_tools_version} %endif BuildRequires: glib2-devel >= %{glib2_version} BuildRequires: gobject-introspection-devel >= 0.10.3 @@ -94,14 +103,22 @@ BuildRequires: gtk-doc BuildRequires: libudev-devel BuildRequires: libuuid-devel BuildRequires: libgudev1-devel >= 143 +BuildRequires: libselinux-devel BuildRequires: vala-tools BuildRequires: iptables BuildRequires: systemd >= 200-3 systemd-devel BuildRequires: libsoup-devel BuildRequires: libndp-devel >= 1.0 +%if 0%{?rhel} || (0%{?fedora} && 0%{?fedora} > 19) BuildRequires: ModemManager-glib-devel >= 1.0 +%endif +%if 0%{?with_nmtui} BuildRequires: newt-devel +%endif +%if 0%{?with_teamctl} BuildRequires: teamd-devel +%endif + %description NetworkManager is a system network service that manages your network devices @@ -150,7 +167,6 @@ NetworkManager functionality from applications that use glib. %package config-server Summary: NetworkManager config file for "server-like" defaults Group: System Environment/Base -Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} %description config-server This adds a NetworkManager configuration file to make it behave more @@ -162,6 +178,7 @@ ethernet devices with no carrier. This package is intended to be installed by default for server deployments. +%if 0%{with_nmtui} %package tui Summary: NetworkManager curses-based UI Group: System Environment/Base @@ -172,23 +189,19 @@ Requires: %{name}-glib%{?_isa} = %{epoch}:%{version}-%{release} This adds a curses-based "TUI" (Text User Interface) to NetworkManager, to allow performing some of the operations supported by nm-connection-editor and nm-applet in a non-graphical environment. +%endif %prep %setup -q -n NetworkManager-%{realversion} -# nmtui -tar -xf %{SOURCE3} - -%patch1 -p1 -b .explain-dns1-dns2 -%patch2 -p1 -b .newt -%patch3 -p1 -b .rh1029464-settings-default-wired -%patch4 -p1 -b .rh997998-reactivate - -%patch5 -p1 -b .rh1031763-1 -%patch6 -p1 -b .rh1031763-2 -%patch7 -p1 -b .rh1031763-3 - -%patch8 -p1 -b .loopback +%patch1 -p1 -b .0001.explain-dns1-dns2.orig +%patch2 -p1 -b .rh1070617-ifcfg-err +%patch3 -p1 -b .rh1078720-device-removed +%patch4 -p1 -b .rh1067170-alias-fix +%patch5 -p1 -b .rh1070829-resolv-selinux +%patch6 -p1 -b .rh799241-dcb-carrier +%patch7 -p1 -b .rh1083624-master-ignore-carrier +%patch8 -p1 -b .rh1084554-balance-queued-state-lock %build @@ -207,17 +220,14 @@ tar -xf %{SOURCE3} --with-crypto=nss \ --enable-more-warnings=error \ --enable-ppp=yes \ +%if 0%{?rhel} || (0%{?fedora} > 19) --with-modem-manager-1=yes \ -%if 0%{?fedora} - --enable-bluez4=no \ %else -%if 0%{?rhel} - --enable-bluez4=yes \ -%endif + --with-modem-manager-1=no \ %endif --enable-wimax=no \ --enable-vala=yes \ -%if %{regen_docs} +%if 0%{?regen_docs} --enable-gtk-doc \ %endif %if 0%{?fedora} @@ -225,7 +235,13 @@ tar -xf %{SOURCE3} %else --with-wext=no \ %endif +%if 0%{?with_teamctl} + --enable-teamctl=yes \ +%else + --enable-teamctl=no \ +%endif --enable-polkit=yes \ + --with-selinux=yes \ --enable-modify-system=yes \ --enable-concheck \ --with-session-tracking=systemd \ @@ -242,16 +258,6 @@ tar -xf %{SOURCE3} make %{?_smp_mflags} -# nmtui -pushd nmtui-%{nmtui_version} - NETWORKMANAGER_CFLAGS='-I$(top_builddir)/../include -I$(top_builddir)/../libnm-util -I$(top_builddir)/../libnm-glib `pkg-config --cflags gio-2.0 dbus-glib-1`' - export NETWORKMANAGER_CFLAGS - NETWORKMANAGER_LIBS='-L$(top_builddir)/../libnm-util/.libs -L$(top_builddir)/../libnm-glib/.libs -lnm-util -lnm-glib `pkg-config --libs gio-2.0 dbus-glib-1`' - export NETWORKMANAGER_LIBS - %configure - make %{?_smp_mflags} -popd - %install %{__rm} -rf $RPM_BUILD_ROOT @@ -263,6 +269,8 @@ make install DESTDIR=$RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.d %{__cp} %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.d +%{__cp} %{SOURCE3} . + # create a VPN directory %{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/VPN @@ -293,11 +301,6 @@ install -m 0755 test/.libs/nm-online %{buildroot}/%{_bindir} mkdir -p $RPM_BUILD_ROOT%{systemd_dir}/network-online.target.wants ln -s ../NetworkManager-wait-online.service $RPM_BUILD_ROOT%{systemd_dir}/network-online.target.wants -# install nmtui -pushd nmtui-%{nmtui_version} - make install DESTDIR=$RPM_BUILD_ROOT -popd - %clean %{__rm} -rf $RPM_BUILD_ROOT @@ -344,6 +347,8 @@ fi %{_libexecdir}/nm-dispatcher.action %dir %{_libdir}/NetworkManager %{_libdir}/NetworkManager/libnm-settings-plugin*.so +%{_libdir}/NetworkManager/libnm-device-plugin*.so +%{_libdir}/NetworkManager/libnm-wwan.so %{_mandir}/man1/* %{_mandir}/man5/* %{_mandir}/man8/* @@ -406,11 +411,176 @@ fi %files config-server %defattr(-,root,root,0755) %config %{_sysconfdir}/%{name}/conf.d/00-server.conf +%doc README.nmcs +%if 0%{?with_nmtui} %files tui +%{_bindir}/nmtui %{_bindir}/nmtui-edit +%{_bindir}/nmtui-connect +%{_bindir}/nmtui-hostname +%endif %changelog +* Mon Apr 7 2014 Dan Williams - 1:0.9.9.1-12.git20140326 +- core: fix master interface DHCP handling if ignore-carrier is set (rh #1083624) +- core: fix startup state not finishing correctly (rh #1084554) + +* Wed Apr 2 2014 Dan Williams - 1:0.9.9.1-11.git20140326 +- core: additional fixes for Data Center Bridging (DCB) (rh #799241) (rh #1081991) +- core: ensure /etc/resolv.conf has the right SELinux label (rh #1070829) + +* Thu Mar 27 2014 Dan Winship - 1:0.9.9.1-10.git20140326 +- core: update NMManager:devices before emitting notify::devices (rh #1078720) + +* Wed Mar 26 2014 Dan Williams - 1:0.9.9.1-9.git20140326 +- core: fix an issue with alias support touching non-alias address labels (rh #1067170) + +* Wed Mar 26 2014 Dan Williams - 1:0.9.9.1-8.git20140326 +- core: fix management of some static configurations from initramfs (rh #1077743) +- ifcfg-rh: add support for alias files (rh #1067170) +- core: additional fixes for Data Center Bridging (DCB) (rh #799241) + +* Tue Mar 25 2014 Dan Winship - 1:0.9.9.1-7.git20140313 +- ifcfg-rh: give a better error on "permission denied" (rh #1070617) +- tui: allow cancelling with "Esc" from "nmtui connect" (rh #1080059) + +* Fri Mar 21 2014 Dan Winship - 1:0.9.9.1-6.git20140313 +- tui: misc fixes (rh #1078281) + +* Fri Mar 21 2014 Dan Winship - 1:0.9.9.1-5.git20140313 +- devices: send ARPs when configuring static IPv4 addresses (rh #1073447) + +* Mon Mar 17 2014 Dan Williams - 1:0.9.9.1-4.git20140313 +- core: fix startup auto-activation of slow carrier detect interfaces (rh #1076592) +- core: align default bridge priority with kernel defaults (rh #1073664) + +* Thu Mar 13 2014 Dan Williams - 1:0.9.9.1-3.git20140313 +- core: read and assume team port configuration (rh #1035859) +- core: looser IPv6 existing configuration assumption (rh #1073824) +- core: follow network interface renames (rh #907836) +- core: add support for VXLAN interfaces (rh #1066705) +- wifi: fix connections to hidden SSIDs (rh #1069844) +- cli: allow using master connection name when creating slaves (rh #1057494) +- ifcfg-rh: fix reading and writing of Team port configurations (rh #1074160) + +* Fri Mar 7 2014 Jiří Klimeš - 1:0.9.9.1-2.git20140228 +- core: fix adding gateway route for IPv6 (rh #1072410) +- core: unschedule deletion of sw device when activating request (rh #1073015) +- cli: fix a crash when trying to set a white-space string as IP (rh #1071394) +- core: correctly handle pre-activation dependency failure (rh #1069695) +- libnm-util, libnm-glib: Add master/slave-matching utils (rh #1045203) +- rdisc: set the expiration timer correctly (rh #1073560) +- core,libnm-glib: support 'type', 'id' properties in NMActiveConnection (rh #1061822) +- core: reenable auto activation for slave connections with a matching UUID master +- core: implement function nm_active_connection_get_uuid() +- core: rename function nm_active_connection_get_name() to nm_active_connection_get_id() +- libnm-glib: fix a double free in NMDeviceVlan +- platform: fix converting address flags in nm_platform_ip6_address_to_string() +- core: postpone non-static master IP configuration until carrier +- core: match IPv4 'disabled' method to 'auto' when device has no link +- core: refactor connection matching and add testcase +- policy: fix crash caused by calling functions on connection==NULL + +* Tue Mar 4 2014 Dan Winship - 1:0.9.9.1-1.git20140228 +- rdisc: obey rtr_solicitations and rtr_solicitation_interval (rh #1071446) + +* Thu Feb 27 2014 Thomas Haller - 1:0.9.9.1-0.git20140228 +- new snapshot version 0.9.9.1 +- cli: show warning when setting band/channel for infrastructure mode wifi (rh #1000096) +- cli: better checking of WEP key types in interactive editor (rh #1040964) +- core: fix crash while wrongly switching device to state NEED_AUTH (rh #1058308) +- core: fix crash during re-activation with pending activation request (rh #1058843) +- cli: support set/appending container types in modify command and interactive editor (rh #1044027) + +* Wed Feb 19 2014 Dan Williams - 1:0.9.9.0-39.git20140131 +- core: fix startup tracking (rh #1030583) + +* Fri Jan 31 2014 Dan Williams - 1:0.9.9.0-38.git20140131 +- core: fix crash getting secrets in libnm-glib + +* Fri Jan 31 2014 Dan Winship - 1:0.9.9.0-37.git20140131 +- dbus: kill at_console usage in permissions (rh #979416) +- policy: allow inactive (remote/SSH) sessions to perform some actions (rh #979416) +- cli: consolidate active and configured connections (rh #997999) +- core/rdisc: add support for IPv6 privacy (rh #1003859) +- core/platform: revise failure to activate connection on error of setting route (rh #1005416) +- core/platform: sort routes before adding them in nm_platform_ipX_route_sync() (rh #1005416) +- vpn: handle missing tunnel interface for IP-based VPNs (rh #1030068) +- core: make NMDeviceTun 'mode' immutable and set at construct time (rh #1034737) +- core/rdisc: add autoconf addresses as /64 (instead of /128) (rh #1044590) +- ifcfg-rh: unescape Team configuration (rh #1051517) +- core: fix a crash with autoconnect masters with autoconnect slaves (rh #1054194) +- libnm-glib: additional functions to get nameservers (rh #1056146) + +* Mon Jan 27 2014 Dan Williams - 1:0.9.9.0-36.git20140127 +- core: fix managing IPv6 connections without disruption on startup (rh #1052157) + +* Fri Jan 24 2014 Daniel Mach - 1:0.9.9.0-35.git20140122 +- Mass rebuild 2014-01-24 + +* Thu Jan 23 2014 Dan Winship - 1:0.9.9.0-34.git20140122 +- core: various fixes to autoconnect retry handling (rh #1029480) + +* Wed Jan 22 2014 Dan Winship - 1:0.9.9.0-33.git20140122 +- platform: fix physical_port_id handling (rh #804527) + +* Wed Jan 22 2014 Dan Williams - 1:0.9.9.0-32.git20140122 +- core: add host route for DHCPv4 server if outside assigned subnet (rh #983325) +- core: set classful prefix length for DHCPv4 static routes +- core: only request wired 802.1x secrets during initial connection +- cli: fix crash when edited connection removed by another client (rh #1011942) +- cli: add help for second-level commands (rh #1034119) + +* Thu Jan 16 2014 Dan Winship - 1:0.9.9.0-31.git20140108 +- tui: various bugfixes (rh #1025021) + +* Wed Jan 8 2014 Dan Williams - 1:0.9.9.0-30.git20130108 +- core: ignore public-suffix search domains like ".com" or ".net" (#851521) +- core: don't touch virtual devices on suspend/resume (rh #1038158) +- core: fix handling of local nameservers in resolv.conf on startup (rh #1035861) +- core: fix race with 'network' service at boot (rh #1034983) +- core: fix stale information in dispatcher DHCP lease change events +- cli: more compact 'nmcli dev' output format (rh #998003) +- cli: make some mandatory parameters actually mandatory (rh #953397) +- cli: enhance help documentation and bash completion (rh #1036545) +- cli: show VPN connection information (rh #1036132) + +* Fri Dec 27 2013 Daniel Mach - 1:0.9.9.0-29.git20131212 +- Mass rebuild 2013-12-27 + +* Thu Dec 12 2013 Dan Williams - 0.9.9.0-28.git20131212 +- core: fix auto-activation after deactivation (rh #1033187) +- core: delay startup complete for initial carrier (rh #1030583) +- wifi: fix possible crashes checking associated AP (rh #1025371) +- core: fix sending of hostname to DHCP server (rh #1001529) +- core: don't retry a failed connection indefinitely (rh #1040528) +- core: add reconnect delay for PPPoE connections (rh #1023503) +- core: fix handling of routes with gateway in keyfiles (bgo #719851) +- core: fix wierd profile doubling on restart (rh #1029859) +- core: ensure software connections can be auto-activated after creationg (rh #1035814) +- core: fix setting broadcast address (rh #1032819) +- core: fix handling of PtP addresses for VPNs (rh #1018317) +- cli: fix help command for connection object (rh #1036545) +- core: fix connection auto-activation based on timestamp order (rh #1029854) +- core: fix connecting VLAN interfaces without a specific interface name (rh #1034908) +- core: fix crash canceling secrets requests (rh #922855) +- libnm-glib: fix crash when connections are deleted remotely (rh #1030403) +- cli: add "nmcli con load file..." (bgo #709830) +- core: use disable_ipv6 in the right situations (rh #1004255) +- cli: fix crash on editing 'lo' connection (rh #1030395) +- core: ignore RA-provided IPv6 default routes (rh #1042402) +- core: fix various issues found by Coverity (rh #1025894) +- cli: add bash completion for hostname commands (rh #1018510) +- core: require secondary connections to be VPNs (rh #997039) +- core: don't crash if ethernet device has no MAC address (rh #1029053) + +* Tue Dec 3 2013 Dan Winship - 0.9.9.0-27.git20131108 +- nmtui: update to latest snapshot + +* Mon Nov 25 2013 Dan Winship - 0.9.9.0-26.git20131108 +- cli: add "nmcli con load" to fix ifup (rh #1022256) + * Thu Nov 21 2013 Dan Williams - 0.9.9.0-25.git20131108 - core: stop touching the loopback device (rh #1031794)