diff --git a/.NetworkManager.metadata b/.NetworkManager.metadata index 4c9adb5..f46f1a8 100644 --- a/.NetworkManager.metadata +++ b/.NetworkManager.metadata @@ -1 +1 @@ -3735e51b63b34b382b6f52525c9dd2db3c25480e SOURCES/NetworkManager-0.9.9.1.git20140326.4dba720.tar.bz2 +2e8cb7d6ed32a91185c63d27af35c64e8aa25814 SOURCES/NetworkManager-1.0.0.git20150121.b4ea599c.tar.bz2 diff --git a/.gitignore b/.gitignore index 45f560b..0550735 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/NetworkManager-0.9.9.1.git20140326.4dba720.tar.bz2 +SOURCES/NetworkManager-1.0.0.git20150121.b4ea599c.tar.bz2 diff --git a/SOURCES/0002-rh1184923-teamd.patch b/SOURCES/0002-rh1184923-teamd.patch new file mode 100644 index 0000000..338da73 --- /dev/null +++ b/SOURCES/0002-rh1184923-teamd.patch @@ -0,0 +1,50 @@ +From 5ca09aea057bcfe271c2bb35318c82162a0bd8c7 Mon Sep 17 00:00:00 2001 +From: Dan Winship +Date: Thu, 22 Jan 2015 13:59:17 -0500 +Subject: [PATCH] team: fix teamd startup code (rh #1184923) + +Since 03a5a85d, NMDeviceTeam was trying to use priv->teamd_pid to +decide whether a teamd_dbus_vanished() call indicated "teamd hasn't +been started yet" or "teamd was previously started and has now +exited". But this resulted in a race condition, where at startup, a +device could call g_dbus_watch_name(), then launch teamd (causing +teamd_pid to get set), and then have gdbus report that teamd hasn't +been started yet before the newly-launched teamd managed to grab the +bus name. Since teamd_pid would already be set when +teamd_dbus_vanished() was called, it would decide that this meant +"teamd was previously started and has now exited", so it would call +teamd_cleanup(), killing the just-started teamd process. + +Fix this by having teamd_dbus_vanished() check priv->tdc instead, +which doesn't get set until after the first teamd_dbus_appeared() +call. +--- + src/devices/team/nm-device-team.c | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/src/devices/team/nm-device-team.c b/src/devices/team/nm-device-team.c +index a03ad3f..88b1d0c 100644 +--- a/src/devices/team/nm-device-team.c ++++ b/src/devices/team/nm-device-team.c +@@ -351,14 +351,11 @@ teamd_dbus_vanished (GDBusConnection *connection, + + g_return_if_fail (priv->teamd_dbus_watch); + +- if (!priv->teamd_pid) { ++ if (!priv->tdc) { + /* g_bus_watch_name will always raise an initial signal, to indicate whether the +- * name exists/not exists initially. Do not take this as a failure, until the +- * startup timeout is over. +- * +- * Note that g_bus_watch_name is guaranteed to alternate vanished/appeared signals, +- * so we won't hit this condition again (because the next signal is either 'appeared' +- * or 'timeout'). */ ++ * name exists/not exists initially. Do not take this as a failure if it hadn't ++ * previously appeared. ++ */ + _LOGD (LOGD_TEAM, "teamd not on D-Bus (ignored)"); + return; + } +-- +1.9.3 + diff --git a/SOURCES/0003-rh1160013-rules.patch b/SOURCES/0003-rh1160013-rules.patch new file mode 100644 index 0000000..e390f8e --- /dev/null +++ b/SOURCES/0003-rh1160013-rules.patch @@ -0,0 +1,54 @@ +From 3d9e09a4a0abbaab69c716365dc3a9ba2b717f53 Mon Sep 17 00:00:00 2001 +From: Dan Winship +Date: Tue, 27 Jan 2015 12:35:11 -0500 +Subject: [PATCH] dispatcher: fix ifcfg-rh example dispatcher script (rh + #1160013) + +Routing table entries for a device get flushed when the device is +deactivated, but rules table entries don't, so we have to flush them +by hand. +--- + contrib/fedora/rpm/NetworkManager.spec | 3 ++- + examples/dispatcher/10-ifcfg-rh-routes.sh | 21 +++++++++++++++++---- + 2 files changed, 19 insertions(+), 5 deletions(-) + +diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec +index 70884ff..cf95985 100644 +--- a/examples/dispatcher/10-ifcfg-rh-routes.sh ++++ b/examples/dispatcher/10-ifcfg-rh-routes.sh +@@ -5,7 +5,12 @@ + # interfaces that have routing rules associated with them that can't + # be expressed by NMSettingIPConfig. (Eg, policy-based routing.) + +-# This should be installed in dispatcher.d/pre-up.d/ ++# This should be installed in both dispatcher.d/ and ++# dispatcher.d/pre-up.d/ ++ ++if [ "$2" != "pre-up" -a "$2" != "down" ]; then ++ exit 0 ++fi + + dir=$(dirname "$CONNECTION_FILENAME") + if [ "$dir" != "/etc/sysconfig/network-scripts" ]; then +@@ -15,7 +20,15 @@ profile=$(basename "$CONNECTION_FILENAME" | sed -ne 's/^ifcfg-//p') + if [ -z "$profile" ]; then + exit 0 + fi +- +-if [ -f "$dir/rule-$profile" -o -f "$dir/rule6-$profile" ]; then +- /etc/sysconfig/network-scripts/ifup-routes "$DEVICE_IP_IFACE" "$profile" ++if ! [ -f "$dir/rule-$profile" -o -f "$dir/rule6-$profile" ]; then ++ exit 0 + fi ++ ++case "$2" in ++ pre-up) ++ /etc/sysconfig/network-scripts/ifup-routes "$DEVICE_IP_IFACE" "$profile" ++ ;; ++ down) ++ /etc/sysconfig/network-scripts/ifdown-routes "$DEVICE_IP_IFACE" "$profile" ++ ;; ++esac +-- +1.9.3 + diff --git a/SOURCES/0004-bridge-route-metric.patch b/SOURCES/0004-bridge-route-metric.patch new file mode 100644 index 0000000..650a321 --- /dev/null +++ b/SOURCES/0004-bridge-route-metric.patch @@ -0,0 +1,52 @@ +From b5433097e288b9733c432005b2cf619b6457afce Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Thu, 22 Jan 2015 18:47:32 +0100 +Subject: [PATCH] device: adjust default route metric for BRIDGE device type + +We forgot to include the BRIDGE, so that bridge +devices got a default priority (route-metric) of 950 +Add it between VLAN and MODEM type. + +Also return a different metric for UNKNOWN +device types, but these priorities are not +actually expected. + +(cherry picked from commit 8dce71be74a1c91ca96294c8b6a22bce6b38493e) +--- + src/devices/nm-device.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index 119d4a8..1c75790 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -692,6 +692,8 @@ nm_device_get_priority (NMDevice *self) + return 350; + case NM_DEVICE_TYPE_VLAN: + return 400; ++ case NM_DEVICE_TYPE_BRIDGE: ++ return 425; + case NM_DEVICE_TYPE_MODEM: + return 450; + case NM_DEVICE_TYPE_BT: +@@ -700,9 +702,16 @@ nm_device_get_priority (NMDevice *self) + return 600; + case NM_DEVICE_TYPE_OLPC_MESH: + return 650; +- default: ++ case NM_DEVICE_TYPE_GENERIC: + return 950; ++ case NM_DEVICE_TYPE_UNKNOWN: ++ return 10000; ++ case NM_DEVICE_TYPE_UNUSED1: ++ case NM_DEVICE_TYPE_UNUSED2: ++ /* omit default: to get compiler warning about missing switch cases */ ++ break; + } ++ return 11000; + } + + guint32 +-- +1.9.3 + diff --git a/SOURCES/0005-schedule-early-config.patch b/SOURCES/0005-schedule-early-config.patch new file mode 100644 index 0000000..8e0334a --- /dev/null +++ b/SOURCES/0005-schedule-early-config.patch @@ -0,0 +1,42 @@ +From 16419a5467ca7bf9408030316cf12bc31cdd2e33 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Mon, 26 Jan 2015 15:34:02 +0100 +Subject: [PATCH] device: schedule queued_ip_config_change() after constructing + device + +During queued_ip_config_change(), we eventually call update_ip_config() +and ip4_config_merge_and_apply(). These functions read the IP configuration +from platform and setup the private ip4_config instance. + +Trigger this initialization after constructing the device to setup +the IP configuration. + +Before, for unmanaged devices we would not call ip4_config_merge_and_apply() +until the first platform change event. + +Note that in the worst case we do some unnecessary work due to this, +because queued_ip_config_change() must already be robust to be called +at any time. + +(cherry picked from commit ddac52a61e838b6f2b7e103e2f94276c6dc41037) +--- + src/devices/nm-device.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index 1c75790..dd8fd8f 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -8067,6 +8067,9 @@ constructor (GType type, + g_signal_connect (platform, NM_PLATFORM_SIGNAL_IP6_ROUTE_CHANGED, G_CALLBACK (device_ip_changed), self); + g_signal_connect (platform, NM_PLATFORM_SIGNAL_LINK_CHANGED, G_CALLBACK (link_changed_cb), self); + ++ /* trigger initial ip config change to initialize ip-config */ ++ priv->queued_ip_config_id = g_idle_add (queued_ip_config_change, self); ++ + if (nm_platform_check_support_user_ipv6ll ()) { + int ip_ifindex = nm_device_get_ip_ifindex (self); + +-- +1.9.3 + diff --git a/SOURCES/0006-rh1184997-ip6ll-flush.patch b/SOURCES/0006-rh1184997-ip6ll-flush.patch new file mode 100644 index 0000000..c9ed97f --- /dev/null +++ b/SOURCES/0006-rh1184997-ip6ll-flush.patch @@ -0,0 +1,83 @@ +From cdf17af6579a6ddebc1a76affbfa756432bc6bfa Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Wed, 28 Jan 2015 12:00:00 +0100 +Subject: [PATCH] ip6-config: remove the link-local address on address flush + +If it stays after device dispose a connection is assumed. + +https://bugzilla.redhat.com/show_bug.cgi?id=1184997 +(cherry picked from commit 6771f836ce3518bc75f0cbbed74138f40c890f7d) +--- + src/nm-ip6-config.c | 2 +- + src/platform/nm-platform.c | 7 ++++--- + src/platform/nm-platform.h | 2 +- + 3 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c +index db64e72..63b4260 100644 +--- a/src/nm-ip6-config.c ++++ b/src/nm-ip6-config.c +@@ -375,7 +375,7 @@ nm_ip6_config_commit (const NMIP6Config *config, int ifindex) + g_return_val_if_fail (config != NULL, FALSE); + + /* Addresses */ +- nm_platform_ip6_address_sync (ifindex, priv->addresses); ++ nm_platform_ip6_address_sync (ifindex, priv->addresses, TRUE); + + /* Routes */ + { +diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c +index 14fc44c..f679fe5 100644 +--- a/src/platform/nm-platform.c ++++ b/src/platform/nm-platform.c +@@ -1826,6 +1826,7 @@ nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses, guint3 + * nm_platform_ip6_address_sync: + * @ifindex: Interface index + * @known_addresses: List of addresses ++ * @keep_link_local: Don't remove link-local address + * + * A convenience function to synchronize addresses for a specific interface + * with the least possible disturbance. It simply removes addresses that are +@@ -1834,7 +1835,7 @@ nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses, guint3 + * Returns: %TRUE on success. + */ + gboolean +-nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses) ++nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses, gboolean keep_link_local) + { + GArray *addresses; + NMPlatformIP6Address *address; +@@ -1847,7 +1848,7 @@ nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses) + address = &g_array_index (addresses, NMPlatformIP6Address, i); + + /* Leave link local address management to the kernel */ +- if (IN6_IS_ADDR_LINKLOCAL (&address->address)) ++ if (keep_link_local && IN6_IS_ADDR_LINKLOCAL (&address->address)) + continue; + + if (!array_contains_ip6_address (known_addresses, address)) +@@ -1880,7 +1881,7 @@ gboolean + nm_platform_address_flush (int ifindex) + { + return nm_platform_ip4_address_sync (ifindex, NULL, 0) +- && nm_platform_ip6_address_sync (ifindex, NULL); ++ && nm_platform_ip6_address_sync (ifindex, NULL, FALSE); + } + + /******************************************************************/ +diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h +index 3f37ed6..62eb0f4 100644 +--- a/src/platform/nm-platform.h ++++ b/src/platform/nm-platform.h +@@ -572,7 +572,7 @@ gboolean nm_platform_ip6_address_delete (int ifindex, struct in6_addr address, i + gboolean nm_platform_ip4_address_exists (int ifindex, in_addr_t address, int plen); + gboolean nm_platform_ip6_address_exists (int ifindex, struct in6_addr address, int plen); + gboolean nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses, guint32 device_route_metric); +-gboolean nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses); ++gboolean nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses, gboolean keep_link_local); + gboolean nm_platform_address_flush (int ifindex); + + gboolean nm_platform_ip4_check_reinstall_device_route (int ifindex, const NMPlatformIP4Address *address, guint32 device_route_metric); +-- +1.9.3 + diff --git a/SOURCES/0007-rh1160013-rules-subpackage.patch b/SOURCES/0007-rh1160013-rules-subpackage.patch new file mode 100644 index 0000000..5b47da7 --- /dev/null +++ b/SOURCES/0007-rh1160013-rules-subpackage.patch @@ -0,0 +1,13 @@ +diff -up NetworkManager-1.0.0/src/settings/plugins/ifcfg-rh/reader.c.0007.rh1160013.routing-rules.orig NetworkManager-1.0.0/src/settings/plugins/ifcfg-rh/reader.c +--- NetworkManager-1.0.0/src/settings/plugins/ifcfg-rh/reader.c.0007.rh1160013.routing-rules.orig 2015-01-29 13:40:45.873984094 -0500 ++++ NetworkManager-1.0.0/src/settings/plugins/ifcfg-rh/reader.c 2015-01-29 13:43:14.976072985 -0500 +@@ -1099,7 +1099,8 @@ make_ip4_setting (shvarFile *ifcfg, + route_path = utils_get_route_path (ifcfg->fileName); + + if (utils_has_complex_routes (route_path)) { +- PARSE_WARNING ("'rule-' or 'rule6-' file is present; you will need to use a dispatcher script to apply these routes"); ++ if (!g_file_test ("/etc/NetworkManager/dispatcher.d/10-ifcfg-rh-routes.sh", G_FILE_TEST_EXISTS)) ++ PARSE_WARNING ("'rule-' or 'rule6-' file is present; install the NetworkManager-config-routing-rules package to enable these routes"); + } else if (utils_has_route_file_new_syntax (route_path)) { + /* Parse route file in new syntax */ + route_ifcfg = utils_get_route_ifcfg (ifcfg->fileName, FALSE); diff --git a/SOURCES/0020-rh1103782-firewall-zone-conflict.patch b/SOURCES/0020-rh1103782-firewall-zone-conflict.patch deleted file mode 100644 index 67bdcdc..0000000 --- a/SOURCES/0020-rh1103782-firewall-zone-conflict.patch +++ /dev/null @@ -1,367 +0,0 @@ -From 472dd9aa672de85b49ade5150cbb81497cb8d14d Mon Sep 17 00:00:00 2001 -From: Thomas Haller -Date: Mon, 2 Jun 2014 12:21:57 +0200 -Subject: [PATCH 1/5] firewall: refactor reentrancy for dispose() in - NMFirewallManager - -Signed-off-by: Thomas Haller -(cherry picked from commit dde731f0ade88c690b7cf6465c016b9d2343094b) ---- - src/firewall-manager/nm-firewall-manager.c | 17 +++++------------ - 1 file changed, 5 insertions(+), 12 deletions(-) - -diff --git a/src/firewall-manager/nm-firewall-manager.c b/src/firewall-manager/nm-firewall-manager.c -index 3bf2f24..6d87391 100644 ---- a/src/firewall-manager/nm-firewall-manager.c -+++ b/src/firewall-manager/nm-firewall-manager.c -@@ -44,7 +44,6 @@ typedef struct { - guint name_owner_id; - DBusGProxy * proxy; - gboolean running; -- gboolean disposed; - } NMFirewallManagerPrivate; - - enum { -@@ -247,7 +246,7 @@ nm_firewall_manager_init (NMFirewallManager * self) - NMFirewallManagerPrivate *priv = NM_FIREWALL_MANAGER_GET_PRIVATE (self); - DBusGConnection *bus; - -- priv->dbus_mgr = nm_dbus_manager_get (); -+ priv->dbus_mgr = g_object_ref (nm_dbus_manager_get ()); - priv->name_owner_id = g_signal_connect (priv->dbus_mgr, - NM_DBUS_MANAGER_NAME_OWNER_CHANGED, - G_CALLBACK (name_owner_changed), -@@ -286,20 +285,14 @@ dispose (GObject *object) - { - NMFirewallManagerPrivate *priv = NM_FIREWALL_MANAGER_GET_PRIVATE (object); - -- if (priv->disposed) -- goto out; -- priv->disposed = TRUE; -- - if (priv->dbus_mgr) { -- if (priv->name_owner_id) -- g_signal_handler_disconnect (priv->dbus_mgr, priv->name_owner_id); -- priv->dbus_mgr = NULL; -+ g_signal_handler_disconnect (priv->dbus_mgr, priv->name_owner_id); -+ priv->name_owner_id = 0; -+ g_clear_object (&priv->dbus_mgr); - } - -- if (priv->proxy) -- g_object_unref (priv->proxy); -+ g_clear_object (&priv->proxy); - --out: - /* Chain up to the parent class */ - G_OBJECT_CLASS (nm_firewall_manager_parent_class)->dispose (object); - } --- -1.9.3 - - -From 3e4ab3a8860d916286ea772e85dfa0432893a6d5 Mon Sep 17 00:00:00 2001 -From: Thomas Haller -Date: Mon, 2 Jun 2014 15:56:24 +0200 -Subject: [PATCH 2/5] firewall: refactor allocation of CBInfo data in - NMFirewallManager - -Signed-off-by: Thomas Haller -(cherry picked from commit e3605ab924dd9865ecba9a06de6f5011a9bae3e3) ---- - src/firewall-manager/nm-firewall-manager.c | 21 +++++++++++++++------ - 1 file changed, 15 insertions(+), 6 deletions(-) - -diff --git a/src/firewall-manager/nm-firewall-manager.c b/src/firewall-manager/nm-firewall-manager.c -index 6d87391..52a5444 100644 ---- a/src/firewall-manager/nm-firewall-manager.c -+++ b/src/firewall-manager/nm-firewall-manager.c -@@ -70,6 +70,19 @@ cb_info_free (CBInfo *info) - g_free (info); - } - -+static CBInfo * -+_cb_info_create (const char *iface, FwAddToZoneFunc callback, gpointer user_data) -+{ -+ CBInfo *info; -+ -+ info = g_malloc0 (sizeof (CBInfo)); -+ info->iface = g_strdup (iface); -+ info->callback = callback; -+ info->user_data = user_data; -+ -+ return info; -+} -+ - static void - add_or_change_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) - { -@@ -113,10 +126,7 @@ nm_firewall_manager_add_or_change_zone (NMFirewallManager *self, - return NULL; - } - -- info = g_malloc0 (sizeof (*info)); -- info->iface = g_strdup (iface); -- info->callback = callback; -- info->user_data = user_data; -+ info = _cb_info_create (iface, callback, user_data); - - nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone %s -> %s%s%s", iface, add ? "add" : "change", - zone?"\"":"", zone ? zone : "default", zone?"\"":""); -@@ -166,8 +176,7 @@ nm_firewall_manager_remove_from_zone (NMFirewallManager *self, - return NULL; - } - -- info = g_malloc0 (sizeof (*info)); -- info->iface = g_strdup (iface); -+ info = _cb_info_create (iface, NULL, NULL); - - nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone remove -> %s", iface, zone ); - return dbus_g_proxy_begin_call_with_timeout (priv->proxy, --- -1.9.3 - - -From 28732c8a3589395975ec6113f1fe2bb925acf72c Mon Sep 17 00:00:00 2001 -From: Thomas Haller -Date: Mon, 2 Jun 2014 17:52:33 +0200 -Subject: [PATCH 3/5] firewall: extend logging to show id for async dbus calls - in NMFirewallManager - -Signed-off-by: Thomas Haller -(cherry picked from commit 3bc38ad531b9976577e543229125d7d8274efe82) ---- - src/firewall-manager/nm-firewall-manager.c | 43 +++++++++++++++++++++++------- - 1 file changed, 33 insertions(+), 10 deletions(-) - -diff --git a/src/firewall-manager/nm-firewall-manager.c b/src/firewall-manager/nm-firewall-manager.c -index 52a5444..c99372a 100644 ---- a/src/firewall-manager/nm-firewall-manager.c -+++ b/src/firewall-manager/nm-firewall-manager.c -@@ -60,12 +60,18 @@ typedef struct { - char *iface; - FwAddToZoneFunc callback; - gpointer user_data; -+ guint id; -+ gboolean completed; - } CBInfo; - - static void - cb_info_free (CBInfo *info) - { - g_return_if_fail (info != NULL); -+ -+ if (!info->completed) -+ nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone call cancelled [%u]", info->iface, info->id); -+ - g_free (info->iface); - g_free (info); - } -@@ -73,10 +79,15 @@ cb_info_free (CBInfo *info) - static CBInfo * - _cb_info_create (const char *iface, FwAddToZoneFunc callback, gpointer user_data) - { -+ static guint id; - CBInfo *info; - -- info = g_malloc0 (sizeof (CBInfo)); -+ info = g_malloc (sizeof (CBInfo)); -+ if (++id == 0) -+ ++id; -+ info->id = id; - info->iface = g_strdup (iface); -+ info->completed = FALSE; - info->callback = callback; - info->user_data = user_data; - -@@ -95,16 +106,20 @@ add_or_change_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data - G_TYPE_INVALID)) { - g_assert (error); - if (g_strcmp0 (error->message, "ZONE_ALREADY_SET") != 0) { -- nm_log_warn (LOGD_FIREWALL, "(%s) firewall zone add/change failed: (%d) %s", -- info->iface, error->code, error->message); -+ nm_log_warn (LOGD_FIREWALL, "(%s) firewall zone add/change failed [%u]: (%d) %s", -+ info->iface, info->id, error->code, error->message); - } else { -- nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone add/change failed: (%d) %s", -- info->iface, error->code, error->message); -+ nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone add/change failed [%u]: (%d) %s", -+ info->iface, info->id, error->code, error->message); - } -+ } else { -+ nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone add/change succeeded [%u]", -+ info->iface, info->id); - } - - info->callback (error, info->user_data); - -+ info->completed = TRUE; - g_free (zone); - g_clear_error (&error); - } -@@ -128,8 +143,8 @@ nm_firewall_manager_add_or_change_zone (NMFirewallManager *self, - - info = _cb_info_create (iface, callback, user_data); - -- nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone %s -> %s%s%s", iface, add ? "add" : "change", -- zone?"\"":"", zone ? zone : "default", zone?"\"":""); -+ nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone %s -> %s%s%s [%u]", iface, add ? "add" : "change", -+ zone?"\"":"", zone ? zone : "default", zone?"\"":"", info->id); - return dbus_g_proxy_begin_call_with_timeout (priv->proxy, - add ? "addInterface" : "changeZone", - add_or_change_cb, -@@ -154,11 +169,18 @@ remove_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) - g_assert (error); - /* ignore UNKNOWN_INTERFACE errors */ - if (error->message && !strstr (error->message, "UNKNOWN_INTERFACE")) { -- nm_log_warn (LOGD_FIREWALL, "(%s) firewall zone remove failed: (%d) %s", -- info->iface, error->code, error->message); -+ nm_log_warn (LOGD_FIREWALL, "(%s) firewall zone remove failed [%u]: (%d) %s", -+ info->iface, info->id, error->code, error->message); -+ } else { -+ nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone remove failed [%u]: (%d) %s", -+ info->iface, info->id, error->code, error->message); - } -+ } else { -+ nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone remove succeeded [%u]", -+ info->iface, info->id); - } - -+ info->completed = TRUE; - g_free (zone); - g_clear_error (&error); - } -@@ -178,7 +200,8 @@ nm_firewall_manager_remove_from_zone (NMFirewallManager *self, - - info = _cb_info_create (iface, NULL, NULL); - -- nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone remove -> %s", iface, zone ); -+ nm_log_dbg (LOGD_FIREWALL, "(%s) firewall zone remove -> %s%s%s [%u]", iface, -+ zone?"\"":"", zone ? zone : "*", zone?"\"":"", info->id); - return dbus_g_proxy_begin_call_with_timeout (priv->proxy, - "removeInterface", - remove_cb, --- -1.9.3 - - -From 342f9f90dbbea28d02dd7a5058c1caea7817142c Mon Sep 17 00:00:00 2001 -From: Thomas Haller -Date: Mon, 2 Jun 2014 18:11:54 +0200 -Subject: [PATCH 4/5] firewall: fix ZONE_CONFLICT when removing interface from - zone - -The firewalld removeInterface call fails with ZONE_CONFLICT when -removing an interface from a wrong zone. This can happen, when the -connection gets modified, while being active (which is related to -bgo#724041). - -By not specifying any zone, we remove the interface from the zone -where it currently is added. This behavior was introduced in upstream -firewalld with commit cc3101ab70a3997228be7bc9f45a069c7fccfa36, March 2012, -r0_2_3-1. -This is the behavior we actually want and we don't have to keep proper track -of the current zone. - -https://bugzilla.redhat.com/show_bug.cgi?id=1103782 - -Signed-off-by: Thomas Haller -(cherry picked from commit c598336de8d5a257765bf415b87e2bb7a1140b7d) ---- - src/devices/nm-device.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c -index 8399cf6..dd0ea5a 100644 ---- a/src/devices/nm-device.c -+++ b/src/devices/nm-device.c -@@ -4912,7 +4912,6 @@ nm_device_cleanup (NMDevice *self, NMDeviceStateReason reason) - NMDevicePrivate *priv; - NMDeviceStateReason ignored = NM_DEVICE_STATE_REASON_NONE; - NMConnection *connection = NULL; -- NMSettingConnection *s_con = NULL; - int ifindex; - - g_return_if_fail (NM_IS_DEVICE (self)); -@@ -4937,10 +4936,9 @@ nm_device_cleanup (NMDevice *self, NMDeviceStateReason reason) - if (priv->act_request) - connection = nm_act_request_get_connection (priv->act_request); - if (connection) { -- s_con = nm_connection_get_setting_connection (connection); - nm_firewall_manager_remove_from_zone (priv->fw_manager, - nm_device_get_ip_iface (self), -- nm_setting_connection_get_zone (s_con)); -+ NULL); - } - - ip_check_gw_ping_cleanup (self); --- -1.9.3 - - -From cda973fe9c83ea415d3178973ff7826904b2997f Mon Sep 17 00:00:00 2001 -From: Thomas Haller -Date: Tue, 3 Jun 2014 08:58:20 +0200 -Subject: [PATCH 5/5] firewall: fix ZONE_CONFLICT when adding firewall - interface to zone - -Firewalld call addInterface() fails with ZONE_CONFLICT if the interface -is already part of another zone. This complicates the code in NM, -because we would have to keep better track of the zone in which the -interface currently is. Which might be quite difficult because -the zone might be changed from an external program (so we would have -to monitor the firewall configuration and work around potential races). - -A better and simpler fix is to simply always use the changeZone() call. -This will do the right thing, regardless if the interface is already part -of a zone or not. - -https://bugzilla.redhat.com/show_bug.cgi?id=1103782 - -Signed-off-by: Thomas Haller -(cherry picked from commit c29388bf028d404066e46ea55abc4058abce4078) ---- - src/devices/nm-device.c | 6 +++--- - src/nm-policy.c | 2 +- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c -index dd0ea5a..264d4ab 100644 ---- a/src/devices/nm-device.c -+++ b/src/devices/nm-device.c -@@ -4023,7 +4023,7 @@ out: - - - static void --fw_add_to_zone_cb (GError *error, gpointer user_data) -+fw_change_zone_cb (GError *error, gpointer user_data) - { - NMDevice *self = NM_DEVICE (user_data); - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); -@@ -4072,8 +4072,8 @@ nm_device_activate_schedule_stage3_ip_config_start (NMDevice *self) - priv->fw_call = nm_firewall_manager_add_or_change_zone (priv->fw_manager, - nm_device_get_ip_iface (self), - zone, -- TRUE, -- fw_add_to_zone_cb, -+ FALSE, -+ fw_change_zone_cb, - self); - } - -diff --git a/src/nm-policy.c b/src/nm-policy.c -index b412427..f064fa0 100644 ---- a/src/nm-policy.c -+++ b/src/nm-policy.c -@@ -1886,7 +1886,7 @@ firewall_started (NMFirewallManager *manager, - nm_firewall_manager_add_or_change_zone (priv->fw_manager, - nm_device_get_ip_iface (dev), - nm_setting_connection_get_zone (s_con), -- TRUE, /* add zone */ -+ FALSE, /* still change zone */ - add_or_change_zone_cb, - g_object_ref (dev)); - } --- -1.9.3 - diff --git a/SOURCES/0021-rh1108167-nm-crash-on-device-removal.patch b/SOURCES/0021-rh1108167-nm-crash-on-device-removal.patch deleted file mode 100644 index 7766e6c..0000000 --- a/SOURCES/0021-rh1108167-nm-crash-on-device-removal.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 222d392527d3c74d31d08166eb1580b9c4f5204f Mon Sep 17 00:00:00 2001 -From: Thomas Haller -Date: Wed, 11 Jun 2014 16:47:07 +0200 -Subject: [PATCH 1/1] core: fix deactivation of assumed connections on device - removal (bgo #729833) - -The following procedure leaves an NMActiveConnection around for a deactivated -device, which causes errors in libnm-glib clients when they cannot create the -GObject for the non-existent device of the AC. - -1) allow a device which can assume connections to be activated -2) stop NM, which should leave the device's IP configuration up -3) start NM and allow it to assume the device's existing connection -4) remove the device, either by unplugging it or 'rmmod' - -The device is removed by nm-manager.c::remove_device(), but the device object -is not moved to UNMANAGED state, leaving the NMActiveConnection completely -unaware the device has gone away. - -The nm-manager.c::remove_device() code did not correctly handle moving a -forcibly removed (eg, by unplugging or 'ip link del' or 'rmmod') device to -the UNMANAGED state when the device was active with an assumed connection. -To fix this, make the conditions when the device should be deactivated -on removal much more explicit. - -A device should be deactivated on removal if: - -1) it is forcibly removed, eg by the kernel network interface being -removed due to 'ip link del' or hotplugging, or internally by NM due -to a parent WWAN interface taking priority over a WWAN ethernet interface - -2) if the device cannot assume connections, in which case NetworkManager -must have activated the device and since we cannot assume the connection -on restart, we should deactivate it - -3) if the device is not activated, to ensure that its IPv6 parameters -and other things get reset to the pre-NetworkManager values - -https://bugzilla.gnome.org/show_bug.cgi?id=729833 -https://bugzilla.gnome.org/show_bug.cgi?id=731277 -https://bugzilla.redhat.com/show_bug.cgi?id=1108167 -Related: https://bugzilla.gnome.org/show_bug.cgi?id=729832 - -(cherry picked from commit 4b6f0d50a456a29e17785fb8b13c11ce018b31db) - -Signed-off-by: Thomas Haller ---- - src/nm-manager.c | 29 ++++++++++++++++------------- - 1 file changed, 16 insertions(+), 13 deletions(-) - -diff --git a/src/nm-manager.c b/src/nm-manager.c -index b7e89d7..d45226b 100644 ---- a/src/nm-manager.c -+++ b/src/nm-manager.c -@@ -746,20 +746,23 @@ remove_device (NMManager *manager, NMDevice *device, gboolean quitting) - NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); - - if (nm_device_get_managed (device)) { -- /* Leave configured interfaces up when quitting so they can be -- * taken over again if NM starts up, and to ensure connectivity while -- * NM is gone. Assumed connections don't get taken down even if they -- * haven't been fully activated. -- */ -- -- if ( !nm_device_can_assume_connections (device) -- || (nm_device_get_state (device) != NM_DEVICE_STATE_ACTIVATED) -- || !quitting) { -- NMActRequest *req = nm_device_get_act_request (device); -+ NMActRequest *req = nm_device_get_act_request (device); -+ gboolean unmanage = FALSE; - -- if (!req || !nm_active_connection_get_assumed (NM_ACTIVE_CONNECTION (req))) -- nm_device_set_manager_managed (device, FALSE, NM_DEVICE_STATE_REASON_REMOVED); -- } -+ /* Leave activated interfaces up when quitting so their configuration -+ * can be taken over when NM restarts. This ensures connectivity while -+ * NM is stopped. Devices which do not support connection assumption -+ * cannot be left up. -+ */ -+ if (!quitting) /* Forced removal; device already gone */ -+ unmanage = TRUE; -+ else if (!nm_device_can_assume_connections (device)) -+ unmanage = TRUE; -+ else if (!req) -+ unmanage = TRUE; -+ -+ if (unmanage) -+ nm_device_set_manager_managed (device, FALSE, NM_DEVICE_STATE_REASON_REMOVED); - } - - g_signal_handlers_disconnect_matched (device, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, manager); --- -1.8.3.1 - diff --git a/SOURCES/0022-rh1112020-crash-reading-bridge-sysctl.patch b/SOURCES/0022-rh1112020-crash-reading-bridge-sysctl.patch deleted file mode 100644 index bf0f500..0000000 --- a/SOURCES/0022-rh1112020-crash-reading-bridge-sysctl.patch +++ /dev/null @@ -1,54 +0,0 @@ -From db81083ac2d8feb84d08e1c16ef285243fee7977 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Fri, 6 Jun 2014 18:22:06 +0200 -Subject: [PATCH 1/1] device: don't call strtol() for NULL strings - - #1 0x0000003c47239ea2 in __GI_strtol (nptr=nptr@entry=0x0, endptr=endptr@entry=0x0, base=base@entry=10) at ../stdlib/strtol.c:110 - #2 0x000000000043b896 in update_connection (device=, connection=) at devices/nm-device-bridge.c:308 - #3 0x000000000042ed2f in nm_device_generate_connection (device=device@entry=0xfbb260 [NMDeviceBridge]) at devices/nm-device.c:1644 - #4 0x0000000000481613 in get_existing_connection (device=0xfbb260 [NMDeviceBridge], manager=0xfb2000 [NMManager]) at nm-manager.c:1549 - #5 add_device (self=self@entry=0xfb2000 [NMManager], device=device@entry=0xfbb260 [NMDeviceBridge], generate_con=) - at nm-manager.c:1688 - #6 0x0000000000481f50 in platform_link_added (plink=0x7fffffffdd50, ifindex=695, self=0xfb2000 [NMManager], reason=) - at nm-manager.c:2023 - #7 platform_link_cb (platform=, ifindex=695, plink=0x7fffffffdd50, change_type=, reason=, - user_data=) at nm-manager.c:2038 - -(cherry picked from commit 3ef79ee2492475b213bcdf070a1f7207d4e58b64) ---- - src/devices/nm-device-bridge.c | 17 ++++++++++++----- - 1 file changed, 12 insertions(+), 5 deletions(-) - -diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c -index 92cc9f2..2e6a393 100644 ---- a/src/devices/nm-device-bridge.c -+++ b/src/devices/nm-device-bridge.c -@@ -300,13 +300,20 @@ update_connection (NMDevice *device, NMConnection *connection) - - for (option = master_options; option->name; option++) { - gs_free char *str = nm_platform_master_get_option (ifindex, option->sysname); -- int value = strtol (str, NULL, 10); -+ int value; - -- /* See comments in set_sysfs_uint() about centiseconds. */ -- if (option->user_hz_compensate) -- value /= 100; -+ if (str) { -+ value = strtol (str, NULL, 10); -+ -+ /* See comments in set_sysfs_uint() about centiseconds. */ -+ if (option->user_hz_compensate) -+ value /= 100; - -- g_object_set (s_bridge, option->name, value, NULL); -+ g_object_set (s_bridge, option->name, value, NULL); -+ } else { -+ nm_log_warn (LOGD_BRIDGE, "(%s): failed to read bridge setting '%s'", -+ nm_device_get_iface (device), option->sysname); -+ } - } - } - --- -1.9.3 - diff --git a/SOURCES/0023-rh1093231-mtu-fix.patch b/SOURCES/0023-rh1093231-mtu-fix.patch deleted file mode 100644 index 6f94579..0000000 --- a/SOURCES/0023-rh1093231-mtu-fix.patch +++ /dev/null @@ -1,160 +0,0 @@ -From 0757e33e746f0a203b4a4c5f386307e3a8ed9766 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Thu, 17 Apr 2014 11:15:36 +0200 -Subject: [PATCH] core: fix MTU handling while merging/subtracting IP configs - (bgo #721420) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.gnome.org/show_bug.cgi?id=721420 -https://bugzilla.redhat.com/show_bug.cgi?id=1047083 - -Signed-off-by: Jiří Klimeš ---- - src/nm-ip4-config.c | 12 ++++++++++- - src/tests/test-ip4-config.c | 50 ++++++++++++++++++++++++++++++++++++++++++++- - 2 files changed, 60 insertions(+), 2 deletions(-) - -diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c -index 034d2e9..505bc85 100644 ---- a/src/nm-ip4-config.c -+++ b/src/nm-ip4-config.c -@@ -15,7 +15,7 @@ - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * -- * Copyright (C) 2005 - 2013 Red Hat, Inc. -+ * Copyright (C) 2005 - 2014 Red Hat, Inc. - * Copyright (C) 2006 - 2008 Novell, Inc. - */ - -@@ -502,9 +502,14 @@ nm_ip4_config_merge (NMIP4Config *dst, const NMIP4Config *src) - for (i = 0; i < nm_ip4_config_get_num_searches (src); i++) - nm_ip4_config_add_search (dst, nm_ip4_config_get_search (src, i)); - -+ /* MSS */ - if (!nm_ip4_config_get_mss (dst)) - nm_ip4_config_set_mss (dst, nm_ip4_config_get_mss (src)); - -+ /* MTU */ -+ if (!nm_ip4_config_get_mtu (dst)) -+ nm_ip4_config_set_mtu (dst, nm_ip4_config_get_mtu (src)); -+ - /* NIS */ - for (i = 0; i < nm_ip4_config_get_num_nis_servers (src); i++) - nm_ip4_config_add_nis_server (dst, nm_ip4_config_get_nis_server (src, i)); -@@ -611,9 +616,14 @@ nm_ip4_config_subtract (NMIP4Config *dst, const NMIP4Config *src) - } - } - -+ /* MSS */ - if (nm_ip4_config_get_mss (src) == nm_ip4_config_get_mss (dst)) - nm_ip4_config_set_mss (dst, 0); - -+ /* MTU */ -+ if (nm_ip4_config_get_mtu (src) == nm_ip4_config_get_mtu (dst)) -+ nm_ip4_config_set_mtu (dst, 0); -+ - /* NIS */ - for (i = 0; i < nm_ip4_config_get_num_nis_servers (src); i++) { - guint32 src_nis = nm_ip4_config_get_nis_server (src, i); -diff --git a/src/tests/test-ip4-config.c b/src/tests/test-ip4-config.c -index e2d5694..f08ed24 100644 ---- a/src/tests/test-ip4-config.c -+++ b/src/tests/test-ip4-config.c -@@ -14,7 +14,7 @@ - * 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. -+ * Copyright (C) 2013 - 2014 Red Hat, Inc. - * - */ - -@@ -116,6 +116,8 @@ test_subtract (void) - const char *expected_search = "somewhere.com"; - guint32 expected_nis = addr_to_num ("1.2.3.13"); - guint32 expected_wins = addr_to_num ("2.3.4.5"); -+ guint32 expected_mss = 1400; -+ guint32 expected_mtu = 1492; - - src = build_test_config (); - -@@ -135,6 +137,9 @@ test_subtract (void) - nm_ip4_config_add_nis_server (dst, expected_nis); - nm_ip4_config_add_wins (dst, expected_wins); - -+ nm_ip4_config_set_mss (dst, expected_mss); -+ nm_ip4_config_set_mtu (dst, expected_mtu); -+ - nm_ip4_config_subtract (dst, src); - - /* ensure what's left is what we expect */ -@@ -169,6 +174,9 @@ test_subtract (void) - g_assert_cmpuint (nm_ip4_config_get_num_wins (dst), ==, 1); - g_assert_cmpuint (nm_ip4_config_get_wins (dst, 0), ==, expected_wins); - -+ g_assert_cmpuint (nm_ip4_config_get_mss (dst), ==, expected_mss); -+ g_assert_cmpuint (nm_ip4_config_get_mtu (dst), ==, expected_mtu); -+ - g_object_unref (src); - g_object_unref (dst); - } -@@ -286,6 +294,45 @@ test_add_route_with_source (void) - g_object_unref (a); - } - -+static void -+test_merge_subtract_mss_mtu (void) -+{ -+ NMIP4Config *cfg1, *cfg2, *cfg3; -+ guint32 expected_mss2 = 1400; -+ guint32 expected_mtu2 = 1492; -+ guint32 expected_mss3 = 555; -+ guint32 expected_mtu3 = 666; -+ -+ cfg1 = build_test_config (); -+ cfg2 = build_test_config (); -+ cfg3 = build_test_config (); -+ -+ /* add MSS, MTU to configs to test them */ -+ nm_ip4_config_set_mss (cfg2, expected_mss2); -+ nm_ip4_config_set_mtu (cfg2, expected_mtu2); -+ nm_ip4_config_set_mss (cfg3, expected_mss3); -+ nm_ip4_config_set_mtu (cfg3, expected_mtu3); -+ -+ nm_ip4_config_merge (cfg1, cfg2); -+ /* ensure MSS and MTU are in cfg1 */ -+ g_assert_cmpuint (nm_ip4_config_get_mss (cfg1), ==, expected_mss2); -+ g_assert_cmpuint (nm_ip4_config_get_mtu (cfg1), ==, expected_mtu2); -+ -+ nm_ip4_config_merge (cfg1, cfg3); -+ /* ensure again the same MSS and MTU are in cfg1 */ -+ g_assert_cmpuint (nm_ip4_config_get_mss (cfg1), ==, expected_mss2); -+ g_assert_cmpuint (nm_ip4_config_get_mtu (cfg1), ==, expected_mtu2); -+ -+ nm_ip4_config_subtract (cfg1, cfg2); -+ /* ensure MSS and MTU are zero in cfg1 */ -+ g_assert_cmpuint (nm_ip4_config_get_mss (cfg1), ==, 0); -+ g_assert_cmpuint (nm_ip4_config_get_mtu (cfg1), ==, 0); -+ -+ g_object_unref (cfg1); -+ g_object_unref (cfg2); -+ g_object_unref (cfg3); -+} -+ - /*******************************************/ - - int -@@ -299,6 +346,7 @@ main (int argc, char **argv) - g_test_add_func ("/ip4-config/compare-with-source", test_compare_with_source); - g_test_add_func ("/ip4-config/add-address-with-source", test_add_address_with_source); - g_test_add_func ("/ip4-config/add-route-with-source", test_add_route_with_source); -+ g_test_add_func ("/ip4-config/merge-subtract-mss-mtu", test_merge_subtract_mss_mtu); - - return g_test_run (); - } --- -1.7.11.7 - diff --git a/SOURCES/0025-rh1149996-ifcfg-rh-GATEWAY.patch b/SOURCES/0025-rh1149996-ifcfg-rh-GATEWAY.patch deleted file mode 100644 index 657f049..0000000 --- a/SOURCES/0025-rh1149996-ifcfg-rh-GATEWAY.patch +++ /dev/null @@ -1,228 +0,0 @@ -From e554ef606f0dfd5ab07057824bb3d3dd52170228 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Thu, 19 Jun 2014 15:43:51 +0200 -Subject: [PATCH] ifcfg-rh: write GATEWAY instead of GATEWAY0 to be - ifup-compatible (rh #771673) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=771673 -https://bugzilla.redhat.com/show_bug.cgi?id=1105770 - -Signed-off-by: Jiří Klimeš ---- - .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 147 +++++++++++++++++++++ - src/settings/plugins/ifcfg-rh/writer.c | 25 +++- - 2 files changed, 168 insertions(+), 4 deletions(-) - -diff --git a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c -index 0e5be5d..ff45550 100644 ---- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c -+++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c -@@ -8284,6 +8284,151 @@ test_write_wired_aliases (void) - } - - static void -+test_write_gateway (void) -+{ -+ NMConnection *connection, *reread; -+ NMSettingConnection *s_con; -+ NMSettingWired *s_wired; -+ NMSettingIP4Config *s_ip4; -+ char *uuid, *testfile = NULL, *val; -+ gboolean success; -+ GError *error = NULL; -+ shvarFile *f; -+ NMIP4Address *addr; -+ const char *ip1_str = "1.1.1.3"; -+ const char *ip2_str = "2.2.2.5"; -+ const char *gw1_str = "1.1.1.254"; -+ const char *gw2_str = "2.2.2.254"; -+ struct in_addr ip1, ip2, gw1, gw2; -+ const guint32 prefix = 24; -+ -+ connection = nm_connection_new (); -+ -+ /* Connection setting */ -+ s_con = (NMSettingConnection *) nm_setting_connection_new (); -+ nm_connection_add_setting (connection, NM_SETTING (s_con)); -+ -+ uuid = nm_utils_uuid_generate (); -+ g_object_set (s_con, -+ NM_SETTING_CONNECTION_ID, "Test Write Static Addresses Gateway", -+ NM_SETTING_CONNECTION_UUID, uuid, -+ NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, -+ NULL); -+ g_free (uuid); -+ -+ /* Wired setting */ -+ s_wired = (NMSettingWired *) nm_setting_wired_new (); -+ nm_connection_add_setting (connection, NM_SETTING (s_wired)); -+ -+ /* IP4 setting */ -+ s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); -+ nm_connection_add_setting (connection, NM_SETTING (s_ip4)); -+ -+ g_object_set (s_ip4, -+ NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL, -+ NM_SETTING_IP4_CONFIG_MAY_FAIL, TRUE, -+ NULL); -+ -+ inet_pton (AF_INET, ip1_str, &ip1); -+ inet_pton (AF_INET, ip2_str, &ip2); -+ inet_pton (AF_INET, gw1_str, &gw1); -+ inet_pton (AF_INET, gw2_str, &gw2); -+ -+ addr = nm_ip4_address_new (); -+ nm_ip4_address_set_address (addr, ip1.s_addr); -+ nm_ip4_address_set_prefix (addr, prefix); -+ nm_ip4_address_set_gateway (addr, gw1.s_addr); -+ nm_setting_ip4_config_add_address (s_ip4, addr); -+ nm_ip4_address_unref (addr); -+ -+ addr = nm_ip4_address_new (); -+ nm_ip4_address_set_address (addr, ip2.s_addr); -+ nm_ip4_address_set_prefix (addr, prefix); -+ nm_ip4_address_set_gateway (addr, gw2.s_addr); -+ nm_setting_ip4_config_add_address (s_ip4, addr); -+ nm_ip4_address_unref (addr); -+ -+ success = nm_connection_verify (connection, &error); -+ g_assert_no_error (error); -+ g_assert (success); -+ -+ /* Save the ifcfg */ -+ success = writer_new_connection (connection, -+ TEST_SCRATCH_DIR "/network-scripts/", -+ &testfile, -+ &error); -+ g_assert_no_error (error); -+ g_assert (success); -+ -+ f = svNewFile (testfile); -+ g_assert (f); -+ -+ /* re-read the file to check that the keys was written as IPADDR, GATEWAY and IPADDR1, GATEWAY1 */ -+ val = svGetValue (f, "IPADDR", FALSE); -+ g_assert (val); -+ g_assert_cmpstr (val, ==, ip1_str); -+ g_free (val); -+ -+ val = svGetValue (f, "IPADDR1", FALSE); -+ g_assert (val); -+ g_assert_cmpstr (val, ==, ip2_str); -+ g_free (val); -+ -+ val = svGetValue (f, "IPADDR0", FALSE); -+ g_assert (val == NULL); -+ -+ val = svGetValue (f, "PREFIX", FALSE); -+ g_assert (val); -+ g_assert_cmpstr (val, ==, "24"); -+ g_free (val); -+ -+ val = svGetValue (f, "PREFIX1", FALSE); -+ g_assert (val); -+ g_assert_cmpstr (val, ==, "24"); -+ g_free (val); -+ -+ val = svGetValue (f, "PREFIX0", FALSE); -+ g_assert (val == NULL); -+ -+ val = svGetValue (f, "GATEWAY", FALSE); -+ g_assert (val); -+ g_assert_cmpstr (val, ==, gw1_str); -+ g_free (val); -+ -+ val = svGetValue (f, "GATEWAY1", FALSE); -+ g_assert (val); -+ g_assert_cmpstr (val, ==, gw2_str); -+ g_free (val); -+ -+ val = svGetValue (f, "GATEWAY0", FALSE); -+ g_assert (val == NULL); -+ -+ -+ svCloseFile (f); -+ -+ /* reread will be normalized, so we must normalize connection too. */ -+ nm_utils_normalize_connection (connection, TRUE); -+ -+ /* re-read the connection for comparison */ -+ reread = connection_from_file (testfile, NULL, TYPE_WIRELESS, NULL, -+ NULL, NULL, NULL, NULL, &error, NULL); -+ unlink (testfile); -+ g_assert_no_error (error); -+ g_assert (reread); -+ -+ success = nm_connection_verify (reread, &error); -+ g_assert_no_error (error); -+ g_assert (success); -+ -+ g_assert (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT)); -+ -+ g_free (testfile); -+ g_object_unref (connection); -+ g_object_unref (reread); -+} -+ -+ -+static void - test_write_wifi_open (void) - { - NMConnection *connection; -@@ -14459,6 +14605,7 @@ int main (int argc, char **argv) - test_write_wired_8021x_tls (NM_SETTING_802_1X_CK_SCHEME_PATH, NM_SETTING_SECRET_FLAG_AGENT_OWNED | NM_SETTING_SECRET_FLAG_NOT_SAVED); - test_write_wired_8021x_tls (NM_SETTING_802_1X_CK_SCHEME_BLOB, NM_SETTING_SECRET_FLAG_NONE); - test_write_wired_aliases (); -+ g_test_add_func (TPATH "ipv4/write-static-addresses-GATEWAY", test_write_gateway); - test_write_wifi_open (); - test_write_wifi_open_hex_ssid (); - test_write_wifi_wep (); -diff --git a/src/settings/plugins/ifcfg-rh/writer.c b/src/settings/plugins/ifcfg-rh/writer.c -index f583366..b9c108c 100644 ---- a/src/settings/plugins/ifcfg-rh/writer.c -+++ b/src/settings/plugins/ifcfg-rh/writer.c -@@ -1913,6 +1913,11 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) - svSetValue (ifcfg, "PREFIX", NULL, FALSE); - svSetValue (ifcfg, "NETMASK", NULL, FALSE); - svSetValue (ifcfg, "GATEWAY", NULL, FALSE); -+ /* Clear out zero-indexed IP address fields */ -+ svSetValue (ifcfg, "IPADDR0", NULL, FALSE); -+ svSetValue (ifcfg, "PREFIX0", NULL, FALSE); -+ svSetValue (ifcfg, "NETMASK0", NULL, FALSE); -+ svSetValue (ifcfg, "GATEWAY0", NULL, FALSE); - - /* Write out IPADDR, PREFIX, GATEWAY for current IP addresses - * without labels. Unset obsolete NETMASK. -@@ -1926,10 +1931,22 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) - if (i > 0 && NM_UTIL_PRIVATE_CALL (nm_setting_ip4_config_get_address_label (s_ip4, i))) - continue; - -- addr_key = g_strdup_printf ("IPADDR%d", n); -- prefix_key = g_strdup_printf ("PREFIX%d", n); -- netmask_key = g_strdup_printf ("NETMASK%d", n); -- gw_key = g_strdup_printf ("GATEWAY%d", n); -+ if (n == 0) { -+ /* Instead of index 0 use un-numbered variables. -+ * It's needed for compatibility with ifup that only recognizes 'GATEAWAY' -+ * See https://bugzilla.redhat.com/show_bug.cgi?id=771673 -+ * and https://bugzilla.redhat.com/show_bug.cgi?id=1105770 -+ */ -+ addr_key = g_strdup ("IPADDR"); -+ prefix_key = g_strdup ("PREFIX"); -+ netmask_key = g_strdup ("NETMASK"); -+ gw_key = g_strdup ("GATEWAY"); -+ } else { -+ addr_key = g_strdup_printf ("IPADDR%d", n); -+ prefix_key = g_strdup_printf ("PREFIX%d", n); -+ netmask_key = g_strdup_printf ("NETMASK%d", n); -+ gw_key = g_strdup_printf ("GATEWAY%d", n); -+ } - - addr = nm_setting_ip4_config_get_address (s_ip4, i); - --- -1.7.11.7 - diff --git a/SOURCES/0026-rh1139326-address-lifetime-dhcp-expiry.patch b/SOURCES/0026-rh1139326-address-lifetime-dhcp-expiry.patch deleted file mode 100644 index bcb0dce..0000000 --- a/SOURCES/0026-rh1139326-address-lifetime-dhcp-expiry.patch +++ /dev/null @@ -1,246 +0,0 @@ -diff -up NetworkManager-0.9.9.1/src/dhcp-manager/nm-dhcp-dhclient-utils.c.0026-rh1139326-address-lifetime-padding.orig NetworkManager-0.9.9.1/src/dhcp-manager/nm-dhcp-dhclient-utils.c ---- NetworkManager-0.9.9.1/src/dhcp-manager/nm-dhcp-dhclient-utils.c.0026-rh1139326-address-lifetime-padding.orig 2014-11-05 12:09:08.367289245 -0600 -+++ NetworkManager-0.9.9.1/src/dhcp-manager/nm-dhcp-dhclient-utils.c 2014-11-05 12:11:32.453938494 -0600 -@@ -27,6 +27,7 @@ - #include "nm-dhcp-dhclient-utils.h" - #include "nm-ip4-config.h" - #include "nm-utils.h" -+#include "NetworkManagerUtils.h" - - #define CLIENTID_TAG "send dhcp-client-identifier" - #define CLIENTID_FORMAT CLIENTID_TAG " \"%s\"; # added by NetworkManager" -@@ -530,6 +531,7 @@ nm_dhcp_dhclient_read_lease_ip_configs ( - GSList *parsed = NULL, *iter, *leases = NULL; - char **line, **split = NULL; - GHashTable *hash = NULL; -+ gint32 now_monotonic_ts; - - g_return_val_if_fail (contents != NULL, NULL); - -@@ -570,6 +572,7 @@ nm_dhcp_dhclient_read_lease_ip_configs ( - g_date_time_ref (now); - else - now = g_date_time_new_now_utc (); -+ now_monotonic_ts = nm_utils_get_monotonic_timestamp_s (); - - for (iter = parsed; iter; iter = g_slist_next (iter)) { - NMIP4Config *ip4; -@@ -624,6 +627,7 @@ nm_dhcp_dhclient_read_lease_ip_configs ( - if (!address.plen) - address.plen = nm_utils_ip4_get_default_prefix (address.address); - -+ address.timestamp = now_monotonic_ts; - address.lifetime = address.preferred = expiry; - address.source = NM_PLATFORM_SOURCE_DHCP; - -diff -up NetworkManager-0.9.9.1/src/platform/nm-platform.c.0026-rh1139326-address-lifetime-padding.orig NetworkManager-0.9.9.1/src/platform/nm-platform.c ---- NetworkManager-0.9.9.1/src/platform/nm-platform.c.0026-rh1139326-address-lifetime-padding.orig 2014-03-26 10:07:56.000000000 -0500 -+++ NetworkManager-0.9.9.1/src/platform/nm-platform.c 2014-11-05 12:12:50.787378771 -0600 -@@ -1370,14 +1370,71 @@ array_contains_ip6_address (const GArray - return FALSE; - } - --/* Compute (a - b) in an overflow-safe manner. */ -+/** -+ * Takes a pair @timestamp and @duration, and returns the remaining duration based -+ * on the new timestamp @now. -+ */ - static guint32 --subtract_guint32 (guint32 a, guint32 b) -+_rebase_relative_time_on_now (guint32 timestamp, guint32 duration, guint32 now, guint32 padding) -+{ -+ gint64 t; -+ -+ if (duration == NM_PLATFORM_LIFETIME_PERMANENT) -+ return NM_PLATFORM_LIFETIME_PERMANENT; -+ -+ if (timestamp == 0) { -+ /* if the @timestamp is zero, assume it was just left unset and that the relative -+ * @duration starts counting from @now. This is convenient to construct an address -+ * and print it in nm_platform_ip4_address_to_string(). -+ * -+ * In general it does not make sense to set the @duration without anchoring at -+ * @timestamp because you don't know the absolute expiration time when looking -+ * at the address at a later moment. */ -+ timestamp = now; -+ } -+ -+ /* For timestamp > now, just accept it and calculate the expected(?) result. */ -+ t = (gint64) timestamp + (gint64) duration - (gint64) now; -+ -+ /* Optional padding to avoid potential races. */ -+ t += (gint64) padding; -+ -+ return (guint32) CLAMP (t, 0, NM_PLATFORM_LIFETIME_PERMANENT - 1); -+} -+ -+static gboolean -+_address_get_lifetime (guint32 timestamp, -+ guint32 orig_lifetime, -+ guint32 orig_preferred, -+ guint32 now, -+ guint32 padding, -+ guint32 *out_lifetime, -+ guint32 *out_preferred) - { -- if (a == G_MAXUINT32) -- return G_MAXUINT32; -+ guint32 lifetime, preferred; -+ -+ if (orig_lifetime == 0) { -+ *out_lifetime = NM_PLATFORM_LIFETIME_PERMANENT; -+ *out_preferred = NM_PLATFORM_LIFETIME_PERMANENT; -+ } else { -+ lifetime = _rebase_relative_time_on_now (timestamp, orig_lifetime, now, padding); -+ if (!lifetime) -+ return FALSE; -+ preferred = _rebase_relative_time_on_now (timestamp, orig_preferred, now, padding); -+ -+ *out_lifetime = lifetime; -+ *out_preferred = MIN (preferred, lifetime); - -- return a > b ? a - b : 0; -+ /* Assert that non-permanent addresses have a (positive) @timestamp. _rebase_relative_time_on_now() -+ * treats addresses with timestamp 0 as *now*. Addresses passed to _address_get_lifetime() always -+ * should have a valid @timestamp, otherwise on every re-sync, their lifetime will be extended anew. -+ */ -+ g_return_val_if_fail ( timestamp != 0 -+ || ( orig_lifetime == NM_PLATFORM_LIFETIME_PERMANENT -+ && orig_preferred == NM_PLATFORM_LIFETIME_PERMANENT), TRUE); -+ g_return_val_if_fail (preferred <= lifetime, TRUE); -+ } -+ return TRUE; - } - - /** -@@ -1417,14 +1474,9 @@ nm_platform_ip4_address_sync (int ifinde - const NMPlatformIP4Address *known_address = &g_array_index (known_addresses, NMPlatformIP4Address, i); - guint32 lifetime, preferred; - -- if (known_address->lifetime) { -- /* Pad the timestamp by 5 seconds to avoid potential races. */ -- guint32 shift = subtract_guint32 (now, known_address->timestamp + 5); -- -- lifetime = subtract_guint32 (known_address->lifetime, shift); -- preferred = subtract_guint32 (known_address->lifetime, shift); -- } else -- lifetime = preferred = NM_PLATFORM_LIFETIME_PERMANENT; -+ /* add a padding of 5 seconds to avoid potential races. */ -+ if (!_address_get_lifetime (known_address->timestamp, known_address->lifetime, known_address->preferred, now, 5, &lifetime, &preferred)) -+ continue; - - if (!nm_platform_ip4_address_add (ifindex, known_address->address, known_address->peer_address, known_address->plen, lifetime, preferred, known_address->label)) - return FALSE; -@@ -1474,14 +1526,9 @@ nm_platform_ip6_address_sync (int ifinde - const NMPlatformIP6Address *known_address = &g_array_index (known_addresses, NMPlatformIP6Address, i); - guint32 lifetime, preferred; - -- if (known_address->lifetime) { -- /* Pad the timestamp by 5 seconds to avoid potential races. */ -- guint32 shift = subtract_guint32 (now, known_address->timestamp + 5); -- -- lifetime = subtract_guint32 (known_address->lifetime, shift); -- preferred = subtract_guint32 (known_address->lifetime, shift); -- } else -- lifetime = preferred = NM_PLATFORM_LIFETIME_PERMANENT; -+ /* add a padding of 5 seconds to avoid potential races. */ -+ if (!_address_get_lifetime (known_address->timestamp, known_address->lifetime, known_address->preferred, now, 5, &lifetime, &preferred)) -+ continue; - - if (!nm_platform_ip6_address_add (ifindex, known_address->address, - known_address->peer_address, known_address->plen, - -From 90a77565d4c2e92e5798c463ca1e3baa4de51662 Mon Sep 17 00:00:00 2001 -From: Dan Williams -Date: Tue, 23 Sep 2014 15:44:55 -0500 -Subject: [PATCH] dhcp: treat lease expiry as failure (rh #1139326) - -Lease expiry means that the DHCP configuration is no longer valid, and -that all attempts to renew/rebind the lease have failed. The IP config -needs to be removed. NetworkManager also sets prefered/valid lifetimes -on addresses, so the kernel will remove them when the lease expires -anyway. That causes removal of the default route, if the default route -was through the device whose config has now expired. - -DHCP clients will typically move to the 'renew' or 'rebind' states when -nearing lease expiry, then if no answer is received move to the 'expire' -state. Eventually they move to the 'fail' state when all attempts to -contact the server have failed. - -Previously, since NM ignored the 'expire' DHCP state it would not clear -out the DHCP IP4 config immediately when the lease expired, instead -waiting for the DHCP client to move to the 'fail' state. But if the -DHCP server appeared between the 'expire' and 'fail' states, NM would -not notice and the device's NMIP4Config would not change, and thus the -Policy would not get the "ip4-config-changed" signal to re-add the -default route that the kernel had previously removed due to the valid -lifetime reaching zero when the lease expired. - -https://bugzilla.redhat.com/show_bug.cgi?id=1139326 - -diff -up NetworkManager-0.9.9.1/src/devices/nm-device.c.foo NetworkManager-0.9.9.1/src/devices/nm-device.c ---- NetworkManager-0.9.9.1/src/devices/nm-device.c.foo 2014-11-19 14:10:04.598128259 -0600 -+++ NetworkManager-0.9.9.1/src/devices/nm-device.c 2014-11-19 14:14:11.661710806 -0600 -@@ -2749,6 +2749,10 @@ dhcp4_state_changed (NMDHCPClient *clien - case DHC_TIMEOUT: /* timed out contacting DHCP server */ - dhcp4_fail (device, TRUE); - break; -+ case DHC_EXPIRE: /* lease expired */ -+ if (priv->ip4_state != IP_DONE) -+ break; -+ /* fall through */ - case DHC_END: /* dhclient exited normally */ - case DHC_FAIL: /* all attempts to contact server timed out, sleeping */ - case DHC_ABEND: /* dhclient exited abnormally */ -@@ -3160,6 +3164,10 @@ dhcp6_state_changed (NMDHCPClient *clien - case DHC_TIMEOUT: /* timed out contacting DHCP server */ - dhcp6_fail (device, TRUE); - break; -+ case DHC_EXPIRE6: /* lease expired */ -+ if (priv->ip6_state != IP_DONE) -+ break; -+ /* fall through */ - case DHC_END: /* dhclient exited normally */ - /* In IPv6 info-only mode, the client doesn't handle leases so it - * may exit right after getting a response from the server. That's - -From acee2eb9e4954eb33b85fa10a3522b8253271126 Mon Sep 17 00:00:00 2001 -From: Dan Williams -Date: Tue, 23 Sep 2014 15:38:33 -0500 -Subject: [PATCH] dhcp: fail the device if DHCP fails after having succeeded - earlier (rh #1139326) - -If DHCP fails to renew or rebind a lease, fail the device since the -IP config is no longer valid. Commit e2b7c482 was actually wrong for -dhcp[4|6]_fail(), since (ip_state == IP_FAIL) will never be true if -DHCP has ever been started, as IP_FAIL is only set from -nm_device_activate_ip[4|6]_config_timeout(), which obviously will not -be called in DHCP code paths if DHCP has previously succeeded. - -diff -up NetworkManager-0.9.9.1/src/devices/nm-device.c.foo NetworkManager-0.9.9.1/src/devices/nm-device.c ---- NetworkManager-0.9.9.1/src/devices/nm-device.c.foo 2014-11-20 18:19:56.260016368 -0600 -+++ NetworkManager-0.9.9.1/src/devices/nm-device.c 2014-11-20 20:52:00.302177894 -0600 -@@ -2700,8 +2700,10 @@ dhcp4_fail (NMDevice *device, gboolean t - - if (timeout || (priv->ip4_state == IP_CONF)) - nm_device_activate_schedule_ip4_config_timeout (device); -- else if (priv->ip4_state == IP_FAIL) -+ else if (priv->ip4_state == IP_DONE) - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); -+ else -+ g_warn_if_reached (); - } - - static void -@@ -3120,8 +3122,10 @@ dhcp6_fail (NMDevice *device, gboolean t - - if (timeout || (priv->ip6_state == IP_CONF)) - nm_device_activate_schedule_ip6_config_timeout (device); -- else if (priv->ip6_state == IP_FAIL) -+ else if (priv->ip6_state == IP_DONE) - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); -+ else -+ g_warn_if_reached (); - } - - static void diff --git a/SOURCES/10-ibft-plugin.conf b/SOURCES/10-ibft-plugin.conf new file mode 100644 index 0000000..482ae2a --- /dev/null +++ b/SOURCES/10-ibft-plugin.conf @@ -0,0 +1,11 @@ +# This file enables the standalone 'iBFT' settings plugin to read +# iBFT information with iscsiadm and create connections from that +# data. +# +# Do not edit this file; it will be overwritten on upgrades. If you +# want to override the values here, or set additional values, you can +# do so by adding another file (eg, "99-local.conf") to this directory +# and setting keys there. + +[main] +plugins+=ibft diff --git a/SOURCES/rh1067170-alias-fix.patch b/SOURCES/rh1067170-alias-fix.patch deleted file mode 100644 index cc7cc2b..0000000 --- a/SOURCES/rh1067170-alias-fix.patch +++ /dev/null @@ -1,70 +0,0 @@ -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/rh1067712-connection-order-fix.patch b/SOURCES/rh1067712-connection-order-fix.patch deleted file mode 100644 index 14edbb5..0000000 --- a/SOURCES/rh1067712-connection-order-fix.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 583eba38280628da9c645d402483f9fd0927005a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Thu, 10 Apr 2014 13:25:41 +0200 -Subject: [PATCH] core: sort connections in descending timestamp order on - take-over (rh #1067712) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When assuming the connections on restart we want to prefer more-recently-used -connections. That's why we have to sort connections according to timestamps in -descending order. That means connections used more recently (higher timestamp) -go before connections with lower timestamp. - -https://bugzilla.redhat.com/show_bug.cgi?id=1067712 - -Signed-off-by: Jiří Klimeš ---- - src/nm-manager.c | 2 +- - src/settings/nm-settings.c | 6 +++++- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/nm-manager.c b/src/nm-manager.c -index d3d660c..f991b04 100644 ---- a/src/nm-manager.c -+++ b/src/nm-manager.c -@@ -1706,7 +1706,7 @@ get_existing_connection (NMManager *manager, NMDevice *device) - * When no configured connection matches the generated connection, we keep - * the generated connection instead. - */ -- connections = g_slist_sort (connections, nm_settings_sort_connections); -+ connections = g_slist_reverse (g_slist_sort (connections, nm_settings_sort_connections)); - matched = nm_utils_match_connection (connections, - connection, - nm_device_has_carrier (device), -diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c -index 852fa6d..b4d9c22 100644 ---- a/src/settings/nm-settings.c -+++ b/src/settings/nm-settings.c -@@ -1685,7 +1685,11 @@ nm_settings_device_removed (NMSettings *self, NMDevice *device, gboolean quittin - - /***************************************************************/ - --/* GCompareFunc helper for sorting "best" connections */ -+/* GCompareFunc helper for sorting "best" connections. -+ * The function sorts connections in ascending timestamp order. -+ * That means an older connection (lower timestamp) goes before -+ * a newer one. -+ */ - gint - nm_settings_sort_connections (gconstpointer a, gconstpointer b) - { --- -1.7.11.7 - diff --git a/SOURCES/rh1070617-ifcfg-permissions.patch b/SOURCES/rh1070617-ifcfg-permissions.patch deleted file mode 100644 index e24c08b..0000000 --- a/SOURCES/rh1070617-ifcfg-permissions.patch +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index 90780f8..0000000 --- a/SOURCES/rh1070829-resolv-conf-selinux.patch +++ /dev/null @@ -1,243 +0,0 @@ -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 deleted file mode 100644 index a1388d6..0000000 --- a/SOURCES/rh1078720-device-removed.patch +++ /dev/null @@ -1,37 +0,0 @@ -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/rh1083153-ignore-cloned-routes.patch b/SOURCES/rh1083153-ignore-cloned-routes.patch deleted file mode 100644 index d5cf01f..0000000 --- a/SOURCES/rh1083153-ignore-cloned-routes.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c -index 7ec3da6..9d90c28 100644 ---- a/src/platform/nm-linux-platform.c -+++ b/src/platform/nm-linux-platform.c -@@ -3141,14 +3141,16 @@ ip_route_mark_all (NMPlatform *platform, int family, int ifindex) - continue; - if (rtnl_route_get_protocol (rtnlroute) == RTPROT_KERNEL) - continue; - if (rtnl_route_get_family (rtnlroute) != family) - continue; - if (rtnl_route_get_nnexthops (rtnlroute) != 1) - continue; -+ if ((family == AF_INET6) && (rtnl_route_get_flags (rtnlroute) & RTM_F_CLONED)) -+ continue; - nexthop = rtnl_route_nexthop_n (rtnlroute, 0); - if (rtnl_route_nh_get_ifindex (nexthop) != ifindex) - continue; - nl_object_mark (object); - count++; - } - diff --git a/SOURCES/rh1083196-ipv6-method-ignore-auto.patch b/SOURCES/rh1083196-ipv6-method-ignore-auto.patch deleted file mode 100644 index ec840fb..0000000 --- a/SOURCES/rh1083196-ipv6-method-ignore-auto.patch +++ /dev/null @@ -1,191 +0,0 @@ -From fbdf8857c32e016005f19ad1e0be0bddc902a6ed Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Thu, 29 May 2014 16:36:24 +0200 -Subject: [PATCH 1/2] core: take over connections with IPv6 method 'ignore' - for 'auto' (rh #1083196) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -If we had a connection with IPv6.method = ignore, we simply ignored IPv6. So -we should assume this connection even if there is an SLAAC address on the -interface. - -https://bugzilla.redhat.com/show_bug.cgi?id=1083196 - -Signed-off-by: Jiří Klimeš ---- - src/NetworkManagerUtils.c | 7 ++++--- - src/tests/test-general.c | 36 ++++++++++++++++++++++++++++++++++++ - 2 files changed, 40 insertions(+), 3 deletions(-) - -diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c -index a3d264a..f869034 100644 ---- a/src/NetworkManagerUtils.c -+++ b/src/NetworkManagerUtils.c -@@ -707,11 +707,12 @@ check_ip6_method (NMConnection *orig, - allow = TRUE; - } - -- /* If the original connection method is 'link-local' and the candidate method -- * is 'ignore' we can take the connection, because NM didn't simply take care -+ /* If the generated connection method is 'link-local' or 'auto' and the candidate -+ * method is 'ignore' we can take the connection, because NM didn't simply take care - * of IPv6. - */ -- if ( strcmp (orig_ip6_method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL) == 0 -+ if ( ( strcmp (orig_ip6_method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL) == 0 -+ || strcmp (orig_ip6_method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0) - && strcmp (candidate_ip6_method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE) == 0) { - allow = TRUE; - } -diff --git a/src/tests/test-general.c b/src/tests/test-general.c -index d103c2b..521998b 100644 ---- a/src/tests/test-general.c -+++ b/src/tests/test-general.c -@@ -368,6 +368,41 @@ test_connection_match_ip6_method_ignore (void) - } - - static void -+test_connection_match_ip6_method_ignore_auto (void) -+{ -+ NMConnection *orig, *copy, *matched; -+ GSList *connections = NULL; -+ NMSettingIP6Config *s_ip6; -+ -+ orig = _match_connection_new (); -+ copy = nm_connection_duplicate (orig); -+ connections = g_slist_append (connections, copy); -+ -+ /* Check that if the generated connection is IPv6 method=auto, and the -+ * candidate is method=ignore, that the candidate is matched. -+ */ -+ s_ip6 = nm_connection_get_setting_ip6_config (orig); -+ g_assert (s_ip6); -+ g_object_set (G_OBJECT (s_ip6), -+ NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, -+ NULL); -+ -+ s_ip6 = nm_connection_get_setting_ip6_config (copy); -+ g_assert (s_ip6); -+ g_object_set (G_OBJECT (s_ip6), -+ NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, -+ NULL); -+ -+ matched = nm_utils_match_connection (connections, orig, TRUE, NULL, NULL); -+ g_assert (matched == copy); -+ -+ g_slist_free (connections); -+ g_object_unref (orig); -+ g_object_unref (copy); -+} -+ -+ -+static void - test_connection_match_ip4_method (void) - { - NMConnection *orig, *copy, *matched; -@@ -568,6 +603,7 @@ main (int argc, char **argv) - g_test_add_func ("/general/connection-match/basic", test_connection_match_basic); - g_test_add_func ("/general/connection-match/ip6-method", test_connection_match_ip6_method); - g_test_add_func ("/general/connection-match/ip6-method-ignore", test_connection_match_ip6_method_ignore); -+ g_test_add_func ("/general/connection-match/ip6-method-ignore-auto", test_connection_match_ip6_method_ignore_auto); - g_test_add_func ("/general/connection-match/ip4-method", test_connection_match_ip4_method); - g_test_add_func ("/general/connection-match/con-interface-name", test_connection_match_interface_name); - g_test_add_func ("/general/connection-match/wired", test_connection_match_wired); --- -1.7.11.7 - - -From a7fa1aed1b9ca46a2c02a39ad023ad7c1cf88baf Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Fri, 30 May 2014 09:06:24 +0200 -Subject: [PATCH 2/2] trivial: clarify comments in test-general.c and - NetworkManagerUtils.c -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - - -Signed-off-by: Jiří Klimeš ---- - src/NetworkManagerUtils.c | 6 +++--- - src/tests/test-general.c | 10 +++++----- - 2 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c -index f869034..4df429a 100644 ---- a/src/NetworkManagerUtils.c -+++ b/src/NetworkManagerUtils.c -@@ -691,7 +691,7 @@ check_ip6_method (NMConnection *orig, - if (!props) - return TRUE; - -- /* If the original connection is 'link-local' and the candidate is both 'auto' -+ /* If the generated connection is 'link-local' and the candidate is both 'auto' - * and may-fail=TRUE, then the candidate is OK to use. may-fail is included - * in the decision because if the candidate is 'auto' but may-fail=FALSE, then - * the connection could not possibly have been previously activated on the -@@ -741,7 +741,7 @@ check_ip4_method (NMConnection *orig, - if (!props) - return TRUE; - -- /* If the original connection is 'disabled' (device had no IP addresses) -+ /* If the generated connection is 'disabled' (device had no IP addresses) - * but it has no carrier, that most likely means that IP addressing could - * not complete and thus no IP addresses were assigned. In that case, allow - * matching to the "auto" method. -@@ -777,7 +777,7 @@ check_connection_interface_name (NMConnection *orig, - if (!props) - return TRUE; - -- /* If one of the interface name is NULL, we accept that connection */ -+ /* If one of the interface names is NULL, we accept that connection */ - s_con_orig = nm_connection_get_setting_connection (orig); - s_con_cand = nm_connection_get_setting_connection (candidate); - orig_ifname = nm_setting_connection_get_interface_name (s_con_orig); -diff --git a/src/tests/test-general.c b/src/tests/test-general.c -index 521998b..11c03f0 100644 ---- a/src/tests/test-general.c -+++ b/src/tests/test-general.c -@@ -308,7 +308,7 @@ test_connection_match_ip6_method (void) - copy = nm_connection_duplicate (orig); - connections = g_slist_append (connections, copy); - -- /* Check that if the original connection is IPv6 method=link-local, and the -+ /* Check that if the generated connection is IPv6 method=link-local, and the - * candidate is both method=auto and may-faily=true, that the candidate is - * matched. - */ -@@ -344,7 +344,7 @@ test_connection_match_ip6_method_ignore (void) - copy = nm_connection_duplicate (orig); - connections = g_slist_append (connections, copy); - -- /* Check that if the original connection is IPv6 method=link-local, and the -+ /* Check that if the generated connection is IPv6 method=link-local, and the - * candidate is method=ignore, that the candidate is matched. - */ - s_ip6 = nm_connection_get_setting_ip6_config (orig); -@@ -413,7 +413,7 @@ test_connection_match_ip4_method (void) - copy = nm_connection_duplicate (orig); - connections = g_slist_append (connections, copy); - -- /* Check that if the original connection is IPv4 method=disabled, and the -+ /* Check that if the generated connection is IPv4 method=disabled, and the - * candidate is both method=auto and may-faily=true, and the device has no - * carrier that the candidate is matched. - */ -@@ -453,8 +453,8 @@ test_connection_match_interface_name (void) - copy = nm_connection_duplicate (orig); - connections = g_slist_append (connections, copy); - -- /* Check that if the original connection is IPv6 method=link-local, and the -- * candidate is method=ignore, that the candidate is matched. -+ /* Check that if the generated connection has an interface name and the -+ * candidate's interface name is NULL, that the candidate is matched. - */ - s_con = nm_connection_get_setting_connection (orig); - g_assert (s_con); --- -1.7.11.7 - diff --git a/SOURCES/rh1083196-match-connections-and-s390.patch b/SOURCES/rh1083196-match-connections-and-s390.patch deleted file mode 100644 index c8a2b6f..0000000 --- a/SOURCES/rh1083196-match-connections-and-s390.patch +++ /dev/null @@ -1,795 +0,0 @@ -From d12b2079bf6508f71a2c6088de1ea1a4d7ae9106 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Wed, 9 Apr 2014 13:48:27 +0200 -Subject: [PATCH 1/5] utils: fix check_possible_match() function -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -We can only allow possible match if all the differences are exceptions. -Before, we accepted the connection if an exception was found, but it is wrong -because there may be another difference (that is fatal). - -Signed-off-by: Jiří Klimeš ---- - src/NetworkManagerUtils.c | 139 ++++++++++++++++++++++++---------------------- - 1 file changed, 74 insertions(+), 65 deletions(-) - -diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c -index 17116ee..e0a232e 100644 ---- a/src/NetworkManagerUtils.c -+++ b/src/NetworkManagerUtils.c -@@ -649,22 +649,47 @@ nm_utils_read_resolv_conf_nameservers (const char *rc_contents) - return nameservers; - } - -+static GHashTable * -+check_property_in_hash (GHashTable *hash, -+ const char *s_name, -+ const char *p_name) -+{ -+ GHashTable *props; -+ -+ props = g_hash_table_lookup (hash, s_name); -+ if ( !props -+ || !g_hash_table_lookup (props, p_name)) { -+ return NULL; -+ } -+ return props; -+} -+ -+static void -+remove_from_hash (GHashTable *s_hash, -+ GHashTable *p_hash, -+ const char *s_name, -+ const char *p_name) -+{ -+ g_hash_table_remove (p_hash, p_name); -+ if (g_hash_table_size (p_hash) == 0) -+ g_hash_table_remove (s_hash, s_name); -+} -+ - static gboolean --check_ip6_method_link_local_auto (NMConnection *orig, -- NMConnection *candidate, -- GHashTable *settings) -+check_ip6_method (NMConnection *orig, -+ NMConnection *candidate, -+ GHashTable *settings) - { - GHashTable *props; - const char *orig_ip6_method, *candidate_ip6_method; - NMSettingIP6Config *candidate_ip6; -+ gboolean allow = FALSE; - -- props = g_hash_table_lookup (settings, NM_SETTING_IP6_CONFIG_SETTING_NAME); -- if ( !props -- || (g_hash_table_size (props) != 1) -- || !g_hash_table_lookup (props, NM_SETTING_IP6_CONFIG_METHOD)) { -- /* For now 'method' is the only difference we handle here */ -- return FALSE; -- } -+ props = check_property_in_hash (settings, -+ NM_SETTING_IP6_CONFIG_SETTING_NAME, -+ NM_SETTING_IP6_CONFIG_METHOD); -+ if (!props) -+ return TRUE; - - /* If the original connection is 'link-local' and the candidate is both 'auto' - * and may-fail=TRUE, then the candidate is OK to use. may-fail is included -@@ -679,60 +704,41 @@ check_ip6_method_link_local_auto (NMConnection *orig, - if ( strcmp (orig_ip6_method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL) == 0 - && strcmp (candidate_ip6_method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0 - && (!candidate_ip6 || nm_setting_ip6_config_get_may_fail (candidate_ip6))) { -- return TRUE; -- } -- -- return FALSE; --} -- --static gboolean --check_ip6_method_link_local_ignore (NMConnection *orig, -- NMConnection *candidate, -- GHashTable *settings) --{ -- GHashTable *props; -- const char *orig_ip6_method, *candidate_ip6_method; -- -- props = g_hash_table_lookup (settings, NM_SETTING_IP6_CONFIG_SETTING_NAME); -- if ( !props -- || (g_hash_table_size (props) != 1) -- || !g_hash_table_lookup (props, NM_SETTING_IP6_CONFIG_METHOD)) { -- /* We only handle ipv6 'method' here */ -- return FALSE; -+ allow = TRUE; - } - - /* If the original connection method is 'link-local' and the candidate method - * is 'ignore' we can take the connection, because NM didn't simply take care - * of IPv6. - */ -- orig_ip6_method = nm_utils_get_ip_config_method (orig, NM_TYPE_SETTING_IP6_CONFIG); -- candidate_ip6_method = nm_utils_get_ip_config_method (candidate, NM_TYPE_SETTING_IP6_CONFIG); -- - if ( strcmp (orig_ip6_method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL) == 0 - && strcmp (candidate_ip6_method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE) == 0) { -- return TRUE; -+ allow = TRUE; - } - -- return FALSE; -+ if (allow) { -+ remove_from_hash (settings, props, -+ NM_SETTING_IP6_CONFIG_SETTING_NAME, -+ NM_SETTING_IP6_CONFIG_METHOD); -+ } -+ return allow; - } - - static gboolean --check_ip4_method_disabled_auto (NMConnection *orig, -- NMConnection *candidate, -- GHashTable *settings, -- gboolean device_has_carrier) -+check_ip4_method (NMConnection *orig, -+ NMConnection *candidate, -+ GHashTable *settings, -+ gboolean device_has_carrier) - { - GHashTable *props; - const char *orig_ip4_method, *candidate_ip4_method; - NMSettingIP4Config *candidate_ip4; - -- props = g_hash_table_lookup (settings, NM_SETTING_IP4_CONFIG_SETTING_NAME); -- if ( !props -- || (g_hash_table_size (props) != 1) -- || !g_hash_table_lookup (props, NM_SETTING_IP4_CONFIG_METHOD)) { -- /* For now 'method' is the only difference we handle here */ -- return FALSE; -- } -+ props = check_property_in_hash (settings, -+ NM_SETTING_IP4_CONFIG_SETTING_NAME, -+ NM_SETTING_IP4_CONFIG_METHOD); -+ if (!props) -+ return TRUE; - - /* If the original connection is 'disabled' (device had no IP addresses) - * but it has no carrier, that most likely means that IP addressing could -@@ -747,9 +753,11 @@ check_ip4_method_disabled_auto (NMConnection *orig, - && strcmp (candidate_ip4_method, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0 - && (!candidate_ip4 || nm_setting_ip4_config_get_may_fail (candidate_ip4)) - && (device_has_carrier == FALSE)) { -+ remove_from_hash (settings, props, -+ NM_SETTING_IP4_CONFIG_SETTING_NAME, -+ NM_SETTING_IP4_CONFIG_METHOD); - return TRUE; - } -- - return FALSE; - } - -@@ -762,13 +770,11 @@ check_connection_interface_name (NMConnection *orig, - const char *orig_ifname, *cand_ifname; - NMSettingConnection *s_con_orig, *s_con_cand; - -- props = g_hash_table_lookup (settings, NM_SETTING_CONNECTION_SETTING_NAME); -- if ( !props -- || (g_hash_table_size (props) != 1) -- || !g_hash_table_lookup (props, NM_SETTING_CONNECTION_INTERFACE_NAME)) { -- /* We only handle 'interface-name' here. */ -- return FALSE; -- } -+ props = check_property_in_hash (settings, -+ NM_SETTING_CONNECTION_SETTING_NAME, -+ NM_SETTING_CONNECTION_INTERFACE_NAME); -+ if (!props) -+ return TRUE; - - /* If one of the interface name is NULL, we accept that connection */ - s_con_orig = nm_connection_get_setting_connection (orig); -@@ -776,9 +782,12 @@ check_connection_interface_name (NMConnection *orig, - orig_ifname = nm_setting_connection_get_interface_name (s_con_orig); - cand_ifname = nm_setting_connection_get_interface_name (s_con_cand); - -- if (!orig_ifname || !cand_ifname) -+ if (!orig_ifname || !cand_ifname) { -+ remove_from_hash (settings, props, -+ NM_SETTING_CONNECTION_SETTING_NAME, -+ NM_SETTING_CONNECTION_INTERFACE_NAME); - return TRUE; -- -+ } - return FALSE; - } - -@@ -790,19 +799,19 @@ check_possible_match (NMConnection *orig, - { - g_return_val_if_fail (settings != NULL, NULL); - -- if (check_ip6_method_link_local_auto (orig, candidate, settings)) -- return candidate; -+ if (!check_ip6_method (orig, candidate, settings)) -+ return NULL; - -- if (check_ip6_method_link_local_ignore (orig, candidate, settings)) -- return candidate; -+ if (!check_ip4_method (orig, candidate, settings, device_has_carrier)) -+ return NULL; - -- if (check_ip4_method_disabled_auto (orig, candidate, settings, device_has_carrier)) -- return candidate; -+ if (!check_connection_interface_name (orig, candidate, settings)) -+ return NULL; - -- if (check_connection_interface_name (orig, candidate, settings)) -+ if (g_hash_table_size (settings) == 0) - return candidate; -- -- return NULL; -+ else -+ return NULL; - } - - /** --- -1.7.11.7 - - -From 1301995202308842c572b2f543f95b37142926d0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Mon, 7 Apr 2014 15:25:09 +0200 -Subject: [PATCH 2/5] device: add s390 values to connection in - update_connection() (rh #1083196) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - - -Signed-off-by: Jiří Klimeš ---- - src/devices/nm-device-ethernet.c | 110 +++++++++++++++++++++++++++------------ - 1 file changed, 78 insertions(+), 32 deletions(-) - -diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c -index e6f091d..920d255 100644 ---- a/src/devices/nm-device-ethernet.c -+++ b/src/devices/nm-device-ethernet.c -@@ -15,7 +15,7 @@ - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * -- * Copyright (C) 2005 - 2013 Red Hat, Inc. -+ * Copyright (C) 2005 - 2014 Red Hat, Inc. - * Copyright (C) 2006 - 2008 Novell, Inc. - */ - -@@ -114,6 +114,8 @@ typedef struct { - char * subchan2; - char * subchan3; - char * subchannels; /* Composite used for checking unmanaged specs */ -+ char * s390_nettype; -+ GHashTable * s390_options; - - /* PPPoE */ - NMPPPManager *ppp_manager; -@@ -145,6 +147,25 @@ nm_ethernet_error_quark (void) - return quark; - } - -+static char * -+get_link_basename (const char *parent_path, const char *name, GError **error) -+{ -+ char buf[128]; -+ char *path; -+ char *result = NULL; -+ -+ path = g_strdup_printf ("%s/%s", parent_path, name); -+ -+ memset (buf, 0, sizeof (buf)); -+ errno = 0; -+ if (readlink (path, &buf[0], sizeof (buf) - 1) >= 0) -+ result = g_path_get_basename (buf); -+ else -+ g_set_error (error, 0, 1, "failed to read link '%s': %d", path, errno); -+ g_free (path); -+ return result; -+} -+ - static void - _update_s390_subchannels (NMDeviceEthernet *self) - { -@@ -192,34 +213,33 @@ _update_s390_subchannels (NMDeviceEthernet *self) - goto out; - } - -- /* FIXME: we probably care about ordering here to ensure that we map -- * cdev0 -> subchan1, cdev1 -> subchan2, etc. -- */ - while ((item = g_dir_read_name (dir))) { -- char buf[50]; -- char *cdev_path; -- -- if (strncmp (item, "cdev", 4)) -- continue; /* Not a subchannel link */ -- -- cdev_path = g_strdup_printf ("%s/%s", parent_path, item); -- -- memset (buf, 0, sizeof (buf)); -- errno = 0; -- if (readlink (cdev_path, &buf[0], sizeof (buf) - 1) >= 0) { -- if (!priv->subchan1) -- priv->subchan1 = g_path_get_basename (buf); -- else if (!priv->subchan2) -- priv->subchan2 = g_path_get_basename (buf); -- else if (!priv->subchan3) -- priv->subchan3 = g_path_get_basename (buf); -- } else { -- nm_log_warn (LOGD_DEVICE | LOGD_HW, -- "(%s): failed to read cdev link '%s': %d", -- iface, cdev_path, errno); -+ if (!strcmp (item, "cdev0")) { -+ priv->subchan1 = get_link_basename (parent_path, "cdev0", &error); -+ } else if (!strcmp (item, "cdev1")) { -+ priv->subchan2 = get_link_basename (parent_path, "cdev1", &error); -+ } else if (!strcmp (item, "cdev2")) { -+ priv->subchan3 = get_link_basename (parent_path, "cdev2", &error); -+ } else if (!strcmp (item, "driver")) { -+ priv->s390_nettype = get_link_basename (parent_path, "driver", &error); -+ } else if ( !strcmp (item, "layer2") -+ || !strcmp (item, "portname") -+ || !strcmp (item, "portno")) { -+ char *path, *value; -+ path = g_strdup_printf ("%s/%s", parent_path, item); -+ value = nm_platform_sysctl_get (path); -+ if (value && *value) -+ g_hash_table_insert (priv->s390_options, g_strdup (item), g_strdup (value)); -+ else -+ nm_log_warn (LOGD_DEVICE | LOGD_HW, "(%s): error reading %s", iface, path); -+ g_free (path); -+ g_free (value); - } -- g_free (cdev_path); -- }; -+ if (error) { -+ nm_log_warn (LOGD_DEVICE | LOGD_HW, "(%s): %s", iface, error->message); -+ g_clear_error (&error); -+ } -+ } - - g_dir_close (dir); - -@@ -250,8 +270,8 @@ out: - - static GObject* - constructor (GType type, -- guint n_construct_params, -- GObjectConstructParam *construct_params) -+ guint n_construct_params, -+ GObjectConstructParam *construct_params) - { - GObject *object; - NMDevice *self; -@@ -268,8 +288,8 @@ constructor (GType type, - || nm_platform_link_get_type (ifindex) == NM_LINK_TYPE_VETH); - - nm_log_dbg (LOGD_HW | LOGD_ETHER, "(%s): kernel ifindex %d", -- nm_device_get_iface (NM_DEVICE (self)), -- nm_device_get_ifindex (NM_DEVICE (self))); -+ nm_device_get_iface (NM_DEVICE (self)), -+ nm_device_get_ifindex (NM_DEVICE (self))); - - /* s390 stuff */ - _update_s390_subchannels (NM_DEVICE_ETHERNET (self)); -@@ -305,8 +325,10 @@ device_state_changed (NMDevice *device, - } - - static void --nm_device_ethernet_init (NMDeviceEthernet * self) -+nm_device_ethernet_init (NMDeviceEthernet *self) - { -+ NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); -+ priv->s390_options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); - } - - NMDevice * -@@ -1543,6 +1565,8 @@ update_connection (NMDevice *device, NMConnection *connection) - static const guint8 null_mac[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 }; - const char *mac_prop = NM_SETTING_WIRED_MAC_ADDRESS; - GByteArray *array; -+ GHashTableIter iter; -+ gpointer key, value; - - if (!s_wired) { - s_wired = (NMSettingWired *) nm_setting_wired_new (); -@@ -1571,6 +1595,26 @@ update_connection (NMDevice *device, NMConnection *connection) - } - - /* We don't set the MTU as we don't know whether it was set explicitly */ -+ -+ /* s390 */ -+ if (priv->subchannels) { -+ GPtrArray *subchan_arr = g_ptr_array_sized_new (3); -+ if (priv->subchan1) -+ g_ptr_array_add (subchan_arr, priv->subchan1); -+ if (priv->subchan2) -+ g_ptr_array_add (subchan_arr, priv->subchan2); -+ if (priv->subchan3) -+ g_ptr_array_add (subchan_arr, priv->subchan3); -+ g_object_set (s_wired, NM_SETTING_WIRED_S390_SUBCHANNELS, subchan_arr, NULL); -+ g_ptr_array_free (subchan_arr, TRUE); -+ } -+ if (priv->s390_nettype) -+ g_object_set (s_wired, NM_SETTING_WIRED_S390_NETTYPE, priv->s390_nettype, NULL); -+ g_hash_table_iter_init (&iter, priv->s390_options); -+ while (g_hash_table_iter_next (&iter, &key, &value)) { -+ nm_setting_wired_add_s390_option (s_wired, (const char *) key, (const char *) value); -+ } -+ - } - - static void -@@ -1638,6 +1682,8 @@ dispose (GObject *object) - g_free (priv->subchan2); - g_free (priv->subchan3); - g_free (priv->subchannels); -+ g_free (priv->s390_nettype); -+ g_hash_table_destroy (priv->s390_options); - - if (priv->pppoe_wait_id) { - g_source_remove (priv->pppoe_wait_id); --- -1.7.11.7 - - -From 7251e4ea22f0a281da87e0d1c28c3405bf75068a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Tue, 8 Apr 2014 10:49:16 +0200 -Subject: [PATCH 3/5] utils: allow matching connections with no MAC (missing - HWADDR) (rh #1083196) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - - -Signed-off-by: Jiří Klimeš ---- - src/NetworkManagerUtils.c | 33 +++++++++++++++++++++++++++++++++ - 1 file changed, 33 insertions(+) - -diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c -index e0a232e..52b7c43 100644 ---- a/src/NetworkManagerUtils.c -+++ b/src/NetworkManagerUtils.c -@@ -791,6 +791,36 @@ check_connection_interface_name (NMConnection *orig, - return FALSE; - } - -+static gboolean -+check_connection_mac_address (NMConnection *orig, -+ NMConnection *candidate, -+ GHashTable *settings) -+{ -+ GHashTable *props; -+ const GByteArray *orig_mac, *cand_mac; -+ NMSettingWired *s_wired_orig, *s_wired_cand; -+ -+ props = check_property_in_hash (settings, -+ NM_SETTING_WIRED_SETTING_NAME, -+ NM_SETTING_WIRED_MAC_ADDRESS); -+ if (!props) -+ return TRUE; -+ -+ /* If one of the MAC addresses is NULL, we accept that connection */ -+ s_wired_orig = nm_connection_get_setting_wired (orig); -+ s_wired_cand = nm_connection_get_setting_wired (candidate); -+ orig_mac = nm_setting_wired_get_mac_address (s_wired_orig); -+ cand_mac = nm_setting_wired_get_mac_address (s_wired_cand); -+ -+ if (!orig_mac || !cand_mac) { -+ remove_from_hash (settings, props, -+ NM_SETTING_WIRED_SETTING_NAME, -+ NM_SETTING_WIRED_MAC_ADDRESS); -+ return TRUE; -+ } -+ return FALSE; -+} -+ - static NMConnection * - check_possible_match (NMConnection *orig, - NMConnection *candidate, -@@ -808,6 +838,9 @@ check_possible_match (NMConnection *orig, - if (!check_connection_interface_name (orig, candidate, settings)) - return NULL; - -+ if (!check_connection_mac_address (orig, candidate, settings)) -+ return NULL; -+ - if (g_hash_table_size (settings) == 0) - return candidate; - else --- -1.7.11.7 - - -From ff2b655691af48cf73d7780fdd662cd861c365c7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Tue, 8 Apr 2014 10:39:31 +0200 -Subject: [PATCH 4/5] tests: improve tests for nm_utils_match_connection() - function -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -nm_utils_match_connection() is the main function used to match connections -when assuming connections on startup. - -Signed-off-by: Jiří Klimeš ---- - src/tests/test-general.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 113 insertions(+) - -diff --git a/src/tests/test-general.c b/src/tests/test-general.c -index ecbda9a..207191f 100644 ---- a/src/tests/test-general.c -+++ b/src/tests/test-general.c -@@ -21,6 +21,7 @@ - #include - #include - #include -+#include - - #include "NetworkManagerUtils.h" - #include "nm-utils.h" -@@ -440,6 +441,116 @@ test_connection_match_interface_name (void) - g_object_unref (copy); - } - -+static void -+test_connection_match_wired (void) -+{ -+ NMConnection *orig, *copy, *matched; -+ GSList *connections = NULL; -+ NMSettingWired *s_wired; -+ GPtrArray *subchan_arr = g_ptr_array_sized_new (3); -+ GByteArray *mac; -+ -+ g_ptr_array_add (subchan_arr, "0.0.8000"); -+ g_ptr_array_add (subchan_arr, "0.0.8001"); -+ g_ptr_array_add (subchan_arr, "0.0.8002"); -+ -+ orig = _match_connection_new (); -+ copy = nm_connection_duplicate (orig); -+ connections = g_slist_append (connections, copy); -+ -+ mac = nm_utils_hwaddr_atoba ("52:54:00:ab:db:23", ARPHRD_ETHER); -+ s_wired = nm_connection_get_setting_wired (orig); -+ g_assert (s_wired); -+ g_object_set (G_OBJECT (s_wired), -+ NM_SETTING_WIRED_PORT, "tp", /* port is not compared */ -+ NM_SETTING_WIRED_MAC_ADDRESS, mac, /* we allow MAC address just in one connection */ -+ NM_SETTING_WIRED_S390_SUBCHANNELS, subchan_arr, -+ NM_SETTING_WIRED_S390_NETTYPE, "qeth", -+ NULL); -+ g_byte_array_free (mac, TRUE); -+ -+ s_wired = nm_connection_get_setting_wired (copy); -+ g_assert (s_wired); -+ g_object_set (G_OBJECT (s_wired), -+ NM_SETTING_WIRED_S390_SUBCHANNELS, subchan_arr, -+ NM_SETTING_WIRED_S390_NETTYPE, "qeth", -+ NULL); -+ -+ matched = nm_utils_match_connection (connections, orig, TRUE, NULL, NULL); -+ g_assert (matched == copy); -+ -+ g_slist_free (connections); -+ g_ptr_array_free (subchan_arr, TRUE); -+ g_object_unref (orig); -+ g_object_unref (copy); -+} -+ -+static void -+test_connection_no_match_ip4_addr (void) -+{ -+ NMConnection *orig, *copy, *matched; -+ GSList *connections = NULL; -+ NMSettingIP4Config *s_ip4; -+ NMSettingIP6Config *s_ip6; -+ NMIP4Address *nm_addr; -+ guint32 addr, gw; -+ -+ orig = _match_connection_new (); -+ copy = nm_connection_duplicate (orig); -+ connections = g_slist_append (connections, copy); -+ -+ /* Check that if we have two differences, ipv6.method (exception we allow) and -+ * ipv4.addresses (which is fatal), we don't match the connections. -+ */ -+ s_ip6 = nm_connection_get_setting_ip6_config (orig); -+ g_assert (s_ip6); -+ g_object_set (G_OBJECT (s_ip6), -+ NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL, -+ NULL); -+ -+ s_ip6 = nm_connection_get_setting_ip6_config (copy); -+ g_assert (s_ip6); -+ g_object_set (G_OBJECT (s_ip6), -+ NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, -+ NULL); -+ -+ -+ s_ip4 = nm_connection_get_setting_ip4_config (orig); -+ g_assert (s_ip4); -+ g_object_set (G_OBJECT (s_ip4), -+ NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL, -+ NULL); -+ nm_addr = nm_ip4_address_new (); -+ inet_pton (AF_INET, "1.1.1.4", &addr); -+ inet_pton (AF_INET, "1.1.1.254", &gw); -+ nm_ip4_address_set_address (nm_addr, addr); -+ nm_ip4_address_set_prefix (nm_addr, 24); -+ nm_ip4_address_set_gateway (nm_addr, gw); -+ nm_setting_ip4_config_add_address (s_ip4, nm_addr); -+ nm_ip4_address_unref (nm_addr); -+ -+ s_ip4 = nm_connection_get_setting_ip4_config (copy); -+ g_assert (s_ip4); -+ g_object_set (G_OBJECT (s_ip4), -+ NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL, -+ NULL); -+ nm_addr = nm_ip4_address_new (); -+ inet_pton (AF_INET, "2.2.2.4", &addr); -+ inet_pton (AF_INET, "2.2.2.254", &gw); -+ nm_ip4_address_set_address (nm_addr, addr); -+ nm_ip4_address_set_prefix (nm_addr, 24); -+ nm_ip4_address_set_gateway (nm_addr, gw); -+ nm_setting_ip4_config_add_address (s_ip4, nm_addr); -+ nm_ip4_address_unref (nm_addr); -+ -+ matched = nm_utils_match_connection (connections, orig, TRUE, NULL, NULL); -+ g_assert (matched != copy); -+ -+ g_slist_free (connections); -+ g_object_unref (orig); -+ g_object_unref (copy); -+} -+ - /*******************************************/ - - int -@@ -457,6 +568,8 @@ main (int argc, char **argv) - g_test_add_func ("/general/connection-match/ip6-method-ignore", test_connection_match_ip6_method_ignore); - g_test_add_func ("/general/connection-match/ip4-method", test_connection_match_ip4_method); - g_test_add_func ("/general/connection-match/con-interface-name", test_connection_match_interface_name); -+ g_test_add_func ("/general/connection-match/wired", test_connection_match_wired); -+ g_test_add_func ("/general/connection-match/no-match-ip4-addr", test_connection_no_match_ip4_addr); - - return g_test_run (); - } --- -1.7.11.7 - - -From 59c0b7258c3bb7bc818b979eb2aeaf9bb9700e29 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Mon, 7 Apr 2014 15:34:10 +0200 -Subject: [PATCH 5/5] device-ethernet: add finalize() method -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - - -Signed-off-by: Jiří Klimeš ---- - src/devices/nm-device-ethernet.c | 26 ++++++++++++++++++-------- - 1 file changed, 18 insertions(+), 8 deletions(-) - -diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c -index 920d255..79e9086 100644 ---- a/src/devices/nm-device-ethernet.c -+++ b/src/devices/nm-device-ethernet.c -@@ -1677,14 +1677,6 @@ dispose (GObject *object) - NMDeviceEthernet *self = NM_DEVICE_ETHERNET (object); - NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); - -- g_clear_object (&priv->supplicant.mgr); -- g_free (priv->subchan1); -- g_free (priv->subchan2); -- g_free (priv->subchan3); -- g_free (priv->subchannels); -- g_free (priv->s390_nettype); -- g_hash_table_destroy (priv->s390_options); -- - if (priv->pppoe_wait_id) { - g_source_remove (priv->pppoe_wait_id); - priv->pppoe_wait_id = 0; -@@ -1697,6 +1689,23 @@ dispose (GObject *object) - } - - static void -+finalize (GObject *object) -+{ -+ NMDeviceEthernet *self = NM_DEVICE_ETHERNET (object); -+ NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); -+ -+ g_clear_object (&priv->supplicant.mgr); -+ g_free (priv->subchan1); -+ g_free (priv->subchan2); -+ g_free (priv->subchan3); -+ g_free (priv->subchannels); -+ g_free (priv->s390_nettype); -+ g_hash_table_destroy (priv->s390_options); -+ -+ G_OBJECT_CLASS (nm_device_ethernet_parent_class)->finalize (object); -+} -+ -+static void - get_property (GObject *object, guint prop_id, - GValue *value, GParamSpec *pspec) - { -@@ -1740,6 +1749,7 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *klass) - /* virtual methods */ - object_class->constructor = constructor; - object_class->dispose = dispose; -+ object_class->finalize = finalize; - object_class->get_property = get_property; - object_class->set_property = set_property; - --- -1.7.11.7 - -From 981e33b83b57377d04fa6caa50a4434c59fb9285 Mon Sep 17 00:00:00 2001 -From: Thomas Haller -Date: Fri, 11 Apr 2014 12:46:53 +0200 -Subject: [PATCH] core: replace readlink() by glib equivalent in - NMDeviceEthernet -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Makes the function working for link destinations longer then 127 bytes and -fixes a potential bug that the result of readlink() was not zero -terminated for long paths. - -Probably this would be no problem, but better be save. - -Related: https://bugzilla.redhat.com/attachment.cgi?id=885371 - -Signed-off-by: Thomas Haller -Signed-off-by: Jiří Klimeš ---- - src/devices/nm-device-ethernet.c | 15 ++++++--------- - 1 file changed, 6 insertions(+), 9 deletions(-) - -diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c -index 79e9086..e9937e4 100644 ---- a/src/devices/nm-device-ethernet.c -+++ b/src/devices/nm-device-ethernet.c -@@ -150,18 +150,15 @@ nm_ethernet_error_quark (void) - static char * - get_link_basename (const char *parent_path, const char *name, GError **error) - { -- char buf[128]; -- char *path; -+ char *link_dest, *path; - char *result = NULL; - - path = g_strdup_printf ("%s/%s", parent_path, name); -- -- memset (buf, 0, sizeof (buf)); -- errno = 0; -- if (readlink (path, &buf[0], sizeof (buf) - 1) >= 0) -- result = g_path_get_basename (buf); -- else -- g_set_error (error, 0, 1, "failed to read link '%s': %d", path, errno); -+ link_dest = g_file_read_link (path, error); -+ if (link_dest) { -+ result = g_path_get_basename (link_dest); -+ g_free (link_dest); -+ } - g_free (path); - return result; - } --- -1.7.11.7 - diff --git a/SOURCES/rh1083624-master-ignore-carrier.patch b/SOURCES/rh1083624-master-ignore-carrier.patch deleted file mode 100644 index 95c07dc..0000000 --- a/SOURCES/rh1083624-master-ignore-carrier.patch +++ /dev/null @@ -1,43 +0,0 @@ -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 deleted file mode 100644 index 56a7aad..0000000 --- a/SOURCES/rh1084554-balance-queued-state-lock.patch +++ /dev/null @@ -1,74 +0,0 @@ -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/rh1086237-dhcpv6-addr-lifetime.patch b/SOURCES/rh1086237-dhcpv6-addr-lifetime.patch deleted file mode 100644 index 1c357df..0000000 --- a/SOURCES/rh1086237-dhcpv6-addr-lifetime.patch +++ /dev/null @@ -1,46 +0,0 @@ -From af9d166197ede942726117965729cf092308f5a8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Wed, 28 May 2014 15:53:17 +0200 -Subject: [PATCH] dhcp: dhclient v6 stores address lifetimes in different - variables (rh #1086237) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -It uses 'new_max_life' for valid lifetime and 'new_preferred_life' for -preferred lifetime. - -https://bugzilla.redhat.com/show_bug.cgi?id=1086237 - -Signed-off-by: Jiří Klimeš ---- - src/dhcp-manager/nm-dhcp-client.c | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) - -diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c -index 6cec744..c8a9461 100644 ---- a/src/dhcp-manager/nm-dhcp-client.c -+++ b/src/dhcp-manager/nm-dhcp-client.c -@@ -1388,10 +1388,16 @@ ip6_options_to_config (NMDHCPClient *self) - - ip6_config = nm_ip6_config_new (); - -- str = g_hash_table_lookup (priv->options, "new_dhcp_lease_time"); -+ str = g_hash_table_lookup (priv->options, "new_max_life"); - if (str) { -- address.lifetime = address.preferred = strtoul (str, NULL, 10); -- nm_log_info (LOGD_DHCP6, " lease time %d", address.lifetime); -+ address.lifetime = strtoul (str, NULL, 10); -+ nm_log_info (LOGD_DHCP6, " valid_lft %d", address.lifetime); -+ } -+ -+ str = g_hash_table_lookup (priv->options, "new_preferred_life"); -+ if (str) { -+ address.preferred = strtoul (str, NULL, 10); -+ nm_log_info (LOGD_DHCP6, " preferred_lft %d", address.preferred); - } - - str = g_hash_table_lookup (priv->options, "new_ip6_address"); --- -1.7.11.7 - diff --git a/SOURCES/rh1086237-ipv6-route-matching.patch b/SOURCES/rh1086237-ipv6-route-matching.patch deleted file mode 100644 index fdb55c3..0000000 --- a/SOURCES/rh1086237-ipv6-route-matching.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 9a98bc74462c11e7906195d359644ca853377170 Mon Sep 17 00:00:00 2001 -From: Dan Winship -Date: Tue, 29 Apr 2014 11:06:53 -0400 -Subject: [PATCH] core: fix connection matching with IPv6 routes (rh #1086237) - -An IPv6 router may have sent us arbitrary routes, so don't consider -them when comparing two method=auto connections. - -(A better fix would be to look at the route lifetime, to see if it's -dynamic or static, but we don't currently have that information.) - -https://bugzilla.gnome.org/show_bug.cgi?id=729203 ---- - src/nm-ip6-config.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff -up NetworkManager-0.9.9.1/src/nm-ip6-config.c.ipv6 NetworkManager-0.9.9.1/src/nm-ip6-config.c ---- NetworkManager-0.9.9.1/src/nm-ip6-config.c.ipv6 2014-05-12 08:02:40.862188963 -0400 -+++ NetworkManager-0.9.9.1/src/nm-ip6-config.c 2014-05-12 08:04:36.251198172 -0400 -@@ -430,7 +430,7 @@ nm_ip6_config_update_setting (const NMIP - /* Routes */ - for (i = 0; i < nroutes; i++) { - const NMPlatformIP6Route *route = nm_ip6_config_get_route (config, i); -- NMIP6Route *s_route = nm_ip6_route_new (); -+ NMIP6Route *s_route; - - /* Ignore link-local route. */ - if (IN6_IS_ADDR_LINKLOCAL (&route->network)) -@@ -440,6 +440,11 @@ nm_ip6_config_update_setting (const NMIP - if (!route->plen) - continue; - -+ /* Assume all routes on 'auto' connections came from the router. */ -+ if (!g_strcmp0 (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) -+ continue; -+ -+ s_route = nm_ip6_route_new (); - nm_ip6_route_set_dest (s_route, &route->network); - nm_ip6_route_set_prefix (s_route, route->plen); - if (!IN6_IS_ADDR_UNSPECIFIED (&route->network)) -@@ -447,6 +452,7 @@ nm_ip6_config_update_setting (const NMIP - nm_ip6_route_set_metric (s_route, route->metric); - - nm_setting_ip6_config_add_route (setting, s_route); -+ nm_ip6_route_unref (s_route); - } - - /* DNS */ diff --git a/SOURCES/rh1091296-dispatch-lease-change.patch b/SOURCES/rh1091296-dispatch-lease-change.patch deleted file mode 100644 index 4421476..0000000 --- a/SOURCES/rh1091296-dispatch-lease-change.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 2f18434cef0ab68343ec464159de940a59f02119 Mon Sep 17 00:00:00 2001 -From: Dan Williams -Date: Tue, 29 Apr 2014 16:42:57 -0500 -Subject: [PATCH] core: emit dhcp4/dhcp6-change dispatcher events if other IP - completes first (rh #1091296) - -If IPv6 completes first it would emit the "up" dispatcher event with IPv6 -details and move the device to ACTIVATED state. But if DHCPv4 was still -running, no dispatcher event would be emitted with the DHCPv4 information -until the first lease renew. Thus dispatcher scripts would not receive -DHCPv4 information for quite some time. - -Ensure that if the other IP version completes first, that when the slower -method's DHCP completes, that it emits the appropriate dhcp4-change -or dhcp6-change event so that dispatcher scripts get the information -as soon as it's available. ---- - src/devices/nm-device.c | 28 ++++++++++++++++++++++++++++ - 1 file changed, 28 insertions(+) - -diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c -index 6005072..2043ae3 100644 ---- a/src/devices/nm-device.c -+++ b/src/devices/nm-device.c -@@ -4481,14 +4481,28 @@ nm_device_activate_ip4_config_commit (gpointer user_data) - if (!start_sharing (self, priv->ip4_config)) { - nm_log_warn (LOGD_SHARING, "Activation (%s) Stage 5 of 5 (IPv4 Commit) start sharing failed.", iface); - nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_SHARED_START_FAILED); - goto out; - } - } - -+ /* If IPv4 wasn't the first to complete, and DHCP was used, then ensure -+ * dispatcher scripts get the DHCP lease information. -+ */ -+ if ( priv->dhcp4_client -+ && nm_device_activate_ip4_state_in_conf (self) -+ && (nm_device_get_state (self) > NM_DEVICE_STATE_IP_CONFIG)) { -+ /* Notify dispatcher scripts of new DHCP4 config */ -+ nm_dispatcher_call (DISPATCHER_ACTION_DHCP4_CHANGE, -+ nm_device_get_connection (self), -+ self, -+ NULL, -+ NULL); -+ } -+ - arp_announce (self); - - /* Enter the IP_CHECK state if this is the first method to complete */ - priv->ip4_state = IP_DONE; - if (nm_device_get_state (self) == NM_DEVICE_STATE_IP_CONFIG) - nm_device_state_changed (self, NM_DEVICE_STATE_IP_CHECK, NM_DEVICE_STATE_REASON_NONE); - -@@ -4558,14 +4572,28 @@ nm_device_activate_ip6_config_commit (gpointer user_data) - g_warn_if_fail (nm_platform_link_is_up (nm_device_get_ip_ifindex (self))); - - /* Allow setting MTU etc */ - if (NM_DEVICE_GET_CLASS (self)->ip6_config_pre_commit) - NM_DEVICE_GET_CLASS (self)->ip6_config_pre_commit (self); - - if (ip6_config_merge_and_apply (self, TRUE, &reason)) { -+ /* If IPv6 wasn't the first IP to complete, and DHCP was used, -+ * then ensure dispatcher scripts get the DHCP lease information. -+ */ -+ if ( priv->dhcp6_client -+ && nm_device_activate_ip6_state_in_conf (self) -+ && (nm_device_get_state (self) > NM_DEVICE_STATE_IP_CONFIG)) { -+ /* Notify dispatcher scripts of new DHCP6 config */ -+ nm_dispatcher_call (DISPATCHER_ACTION_DHCP6_CHANGE, -+ nm_device_get_connection (self), -+ self, -+ NULL, -+ NULL); -+ } -+ - /* Enter the IP_CHECK state if this is the first method to complete */ - priv->ip6_state = IP_DONE; - if (nm_device_get_state (self) == NM_DEVICE_STATE_IP_CONFIG) - nm_device_state_changed (self, NM_DEVICE_STATE_IP_CHECK, NM_DEVICE_STATE_REASON_NONE); - } else { - nm_log_warn (LOGD_DEVICE | LOGD_IP6, - "Activation (%s) Stage 5 of 5 (IPv6 Commit) failed", --- -1.9.0 - diff --git a/SOURCES/rh1096063-NM-w-o-for-IPv4-and-IPv6.patch b/SOURCES/rh1096063-NM-w-o-for-IPv4-and-IPv6.patch deleted file mode 100644 index ffbc772..0000000 --- a/SOURCES/rh1096063-NM-w-o-for-IPv4-and-IPv6.patch +++ /dev/null @@ -1,505 +0,0 @@ -From 116501dbccf7139f942c77e71c4afb5f6d1af6a8 Mon Sep 17 00:00:00 2001 -From: Thomas Haller -Date: Mon, 28 Apr 2014 11:18:05 +0200 -Subject: [PATCH 1/2] core: add parameter to ignore error in add/remove pending - action - -Add a parameter to nm_device_add_pending_action() to silently -accept adding duplicate actions. - -Same for nm_device_remove_pending_action(), to silently ignore -removing non-pending actions. - -Signed-off-by: Thomas Haller -(cherry picked from commit a16faa3985042dadb34600cb0df2eefc61360340) ---- - src/devices/nm-device-olpc-mesh.c | 4 +- - src/devices/nm-device-wifi.c | 8 ++-- - src/devices/nm-device.c | 89 ++++++++++++++++++++++++++------------- - src/devices/nm-device.h | 4 +- - src/nm-active-connection.c | 8 ++-- - src/nm-policy.c | 4 +- - 6 files changed, 74 insertions(+), 43 deletions(-) - -diff --git a/src/devices/nm-device-olpc-mesh.c b/src/devices/nm-device-olpc-mesh.c -index b85956e..52ba79a 100644 ---- a/src/devices/nm-device-olpc-mesh.c -+++ b/src/devices/nm-device-olpc-mesh.c -@@ -627,7 +627,7 @@ check_companion_cb (gpointer user_data) - } - - done: -- nm_device_remove_pending_action (NM_DEVICE (self), "waiting for companion"); -+ nm_device_remove_pending_action (NM_DEVICE (self), "waiting for companion", TRUE); - return FALSE; - } - -@@ -645,7 +645,7 @@ state_changed (NMDevice *device, NMDeviceState new_state, - * transition to DISCONNECTED otherwise wait for our companion. - */ - g_idle_add (check_companion_cb, self); -- nm_device_add_pending_action (device, "waiting for companion"); -+ nm_device_add_pending_action (device, "waiting for companion", TRUE); - break; - case NM_DEVICE_STATE_ACTIVATED: - break; -diff --git a/src/devices/nm-device-wifi.c b/src/devices/nm-device-wifi.c -index d539877..4b231ca 100644 ---- a/src/devices/nm-device-wifi.c -+++ b/src/devices/nm-device-wifi.c -@@ -360,7 +360,7 @@ supplicant_interface_acquire (NMDeviceWifi *self) - } - - if (nm_supplicant_interface_get_state (priv->supplicant.iface) < NM_SUPPLICANT_INTERFACE_STATE_READY) -- nm_device_add_pending_action (NM_DEVICE (self), "waiting for supplicant"); -+ nm_device_add_pending_action (NM_DEVICE (self), "waiting for supplicant", TRUE); - - g_signal_connect (priv->supplicant.iface, - NM_SUPPLICANT_INTERFACE_STATE, -@@ -1722,7 +1722,7 @@ request_wireless_scan (gpointer user_data) - /* success */ - backoff = TRUE; - priv->requested_scan = TRUE; -- nm_device_add_pending_action (NM_DEVICE (self), "scan"); -+ nm_device_add_pending_action (NM_DEVICE (self), "scan", TRUE); - } - - if (ssids) { -@@ -1823,7 +1823,7 @@ supplicant_iface_scan_done_cb (NMSupplicantInterface *iface, - - if (priv->requested_scan) { - priv->requested_scan = FALSE; -- nm_device_remove_pending_action (NM_DEVICE (self), "scan"); -+ nm_device_remove_pending_action (NM_DEVICE (self), "scan", TRUE); - } - } - -@@ -2364,7 +2364,7 @@ supplicant_iface_state_cb (NMSupplicantInterface *iface, - request_wireless_scan (self); - - if (old_state < NM_SUPPLICANT_INTERFACE_STATE_READY) -- nm_device_remove_pending_action (device, "waiting for supplicant"); -+ nm_device_remove_pending_action (device, "waiting for supplicant", TRUE); - break; - case NM_SUPPLICANT_INTERFACE_STATE_COMPLETED: - remove_supplicant_interface_error_handler (self); -diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c -index f16c4d4..b6e7ef2 100644 ---- a/src/devices/nm-device.c -+++ b/src/devices/nm-device.c -@@ -1123,7 +1123,7 @@ nm_device_set_carrier (NMDevice *device, gboolean carrier) - if (priv->carrier_wait_id) { - g_source_remove (priv->carrier_wait_id); - priv->carrier_wait_id = 0; -- nm_device_remove_pending_action (device, "carrier wait"); -+ nm_device_remove_pending_action (device, "carrier wait", TRUE); - } - } else if (state <= NM_DEVICE_STATE_DISCONNECTED) { - nm_log_info (LOGD_DEVICE, "(%s): link disconnected", iface); -@@ -5539,7 +5539,7 @@ carrier_wait_timeout (gpointer user_data) - NMDevice *self = NM_DEVICE (user_data); - - NM_DEVICE_GET_PRIVATE (self)->carrier_wait_id = 0; -- nm_device_remove_pending_action (self, "carrier wait"); -+ nm_device_remove_pending_action (self, "carrier wait", TRUE); - return G_SOURCE_REMOVE; - } - -@@ -5587,10 +5587,10 @@ nm_device_bring_up (NMDevice *self, gboolean block, gboolean *no_firmware) - if (device_has_capability (self, NM_DEVICE_CAP_CARRIER_DETECT)) { - if (priv->carrier_wait_id) { - g_source_remove (priv->carrier_wait_id); -- nm_device_remove_pending_action (self, "carrier wait"); -+ nm_device_remove_pending_action (self, "carrier wait", TRUE); - } - priv->carrier_wait_id = g_timeout_add_seconds (5, carrier_wait_timeout, self); -- nm_device_add_pending_action (self, "carrier wait"); -+ nm_device_add_pending_action (self, "carrier wait", TRUE); - } - - /* Can only get HW address of some devices when they are up */ -@@ -6852,7 +6852,7 @@ queued_set_state (gpointer user_data) - nm_device_queued_state_clear (self); - - nm_device_state_changed (self, new_state, new_reason); -- nm_device_remove_pending_action (self, queued_state_to_string (new_state)); -+ nm_device_remove_pending_action (self, queued_state_to_string (new_state), TRUE); - } else { - g_warn_if_fail (priv->queued_state.state == NM_DEVICE_STATE_UNKNOWN); - g_warn_if_fail (priv->queued_state.reason == NM_DEVICE_STATE_REASON_NONE); -@@ -6876,7 +6876,7 @@ nm_device_queue_state (NMDevice *self, - - /* 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)); -+ nm_device_add_pending_action (self, queued_state_to_string (state), TRUE); - - /* We should only ever have one delayed state transition at a time */ - if (priv->queued_state.id) { -@@ -6917,7 +6917,7 @@ nm_device_queued_state_clear (NMDevice *self) - nm_log_dbg (LOGD_DEVICE, "(%s): clearing queued state transition (id %d)", - nm_device_get_iface (self), priv->queued_state.id); - g_source_remove (priv->queued_state.id); -- nm_device_remove_pending_action (self, queued_state_to_string (priv->queued_state.state)); -+ nm_device_remove_pending_action (self, queued_state_to_string (priv->queued_state.state), TRUE); - } - memset (&priv->queued_state, 0, sizeof (priv->queued_state)); - } -@@ -7651,31 +7651,46 @@ nm_device_set_hw_addr (NMDevice *device, const guint8 *addr, - * nm_device_add_pending_action(): - * @device: the #NMDevice to add the pending action to - * @action: a static string that identifies the action -+ * @assert_not_yet_pending: if %TRUE, assert that the @action is currently not yet pending. -+ * Otherwise, ignore duplicate scheduling of the same action silently. - * - * Adds a pending action to the device. -+ * -+ * Returns: %TRUE if the action was added (and not already added before). %FALSE -+ * if the same action is already scheduled. In the latter case, the action was not scheduled -+ * a second time. - */ --void --nm_device_add_pending_action (NMDevice *device, const char *action) -+gboolean -+nm_device_add_pending_action (NMDevice *device, const char *action, gboolean assert_not_yet_pending) - { - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); - GSList *iter; -- guint count; -+ guint count = 0; - -- g_return_if_fail (action); -+ g_return_val_if_fail (action, FALSE); - -- /* Shouldn't ever add the same pending action twice */ -+ /* Check if the action is already pending. Cannot add duplicate actions */ - for (iter = priv->pending_actions; iter; iter = iter->next) { - if (!strcmp (action, iter->data)) { -- nm_log_warn (LOGD_DEVICE, "(%s): add_pending_action (%d): '%s' already added", -- nm_device_get_iface (device), -- g_slist_length (priv->pending_actions), -- action); -- g_return_if_reached (); -+ if (assert_not_yet_pending) { -+ nm_log_warn (LOGD_DEVICE, "(%s): add_pending_action (%d): '%s' already pending", -+ nm_device_get_iface (device), -+ count + g_slist_length (iter), -+ action); -+ g_return_val_if_reached (FALSE); -+ } else { -+ nm_log_dbg (LOGD_DEVICE, "(%s): add_pending_action (%d): '%s' already pending (expected)", -+ nm_device_get_iface (device), -+ count + g_slist_length (iter), -+ action); -+ } -+ return FALSE; - } -+ count++; - } - - priv->pending_actions = g_slist_append (priv->pending_actions, g_strdup (action)); -- count = g_slist_length (priv->pending_actions); -+ count++; - - nm_log_dbg (LOGD_DEVICE, "(%s): add_pending_action (%d): '%s'", - nm_device_get_iface (device), -@@ -7684,44 +7699,60 @@ nm_device_add_pending_action (NMDevice *device, const char *action) - - if (count == 1) - g_object_notify (G_OBJECT (device), NM_DEVICE_HAS_PENDING_ACTION); -+ -+ return TRUE; - } - - /** - * nm_device_remove_pending_action(): - * @device: the #NMDevice to remove the pending action from - * @action: a static string that identifies the action -+ * @assert_is_pending: if %TRUE, assert that the @action is pending. -+ * If %FALSE, don't do anything if the current action is not pending and -+ * return %FALSE. - * - * Removes a pending action previously added by nm_device_add_pending_action(). -+ * -+ * Returns: whether the @action was pending and is now removed. - */ --void --nm_device_remove_pending_action (NMDevice *device, const char *action) -+gboolean -+nm_device_remove_pending_action (NMDevice *device, const char *action, gboolean assert_is_pending) - { - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); - GSList *iter; -+ guint count = 0; - -- g_return_if_fail (action); -+ g_return_val_if_fail (action, FALSE); - -- /* Shouldn't ever add the same pending action twice */ - for (iter = priv->pending_actions; iter; iter = iter->next) { - if (!strcmp (action, iter->data)) { - g_free (iter->data); - priv->pending_actions = g_slist_delete_link (priv->pending_actions, iter); - nm_log_dbg (LOGD_DEVICE, "(%s): remove_pending_action (%d): '%s'", - nm_device_get_iface (device), -- g_slist_length (priv->pending_actions), -+ count + g_slist_length (iter), - action); - - if (priv->pending_actions == NULL) - g_object_notify (G_OBJECT (device), NM_DEVICE_HAS_PENDING_ACTION); -- return; -+ return TRUE; - } -+ count++; - } - -- nm_log_warn (LOGD_DEVICE, "(%s): remove_pending_action (%d): '%s' never added", -- nm_device_get_iface (device), -- g_slist_length (priv->pending_actions), -- action); -- g_return_if_reached (); -+ if (assert_is_pending) { -+ nm_log_warn (LOGD_DEVICE, "(%s): remove_pending_action (%d): '%s' not pending", -+ nm_device_get_iface (device), -+ count, -+ action); -+ g_return_val_if_reached (FALSE); -+ } else { -+ nm_log_dbg (LOGD_DEVICE, "(%s): remove_pending_action (%d): '%s' not pending (expected)", -+ nm_device_get_iface (device), -+ count, -+ action); -+ } -+ return FALSE; - } - - gboolean -diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h -index 47d7856..935a448 100644 ---- a/src/devices/nm-device.h -+++ b/src/devices/nm-device.h -@@ -328,8 +328,8 @@ void nm_device_queue_activation (NMDevice *device, NMActRequest *req); - - gboolean nm_device_supports_vlans (NMDevice *device); - --void nm_device_add_pending_action (NMDevice *device, const char *action); --void nm_device_remove_pending_action (NMDevice *device, const char *action); -+gboolean nm_device_add_pending_action (NMDevice *device, const char *action, gboolean assert_not_yet_pending); -+gboolean nm_device_remove_pending_action (NMDevice *device, const char *action, gboolean assert_is_pending); - gboolean nm_device_has_pending_action (NMDevice *device); - - GPtrArray *nm_device_get_available_connections (NMDevice *device, -diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c -index 43f8189..172aa61 100644 ---- a/src/nm-active-connection.c -+++ b/src/nm-active-connection.c -@@ -152,7 +152,7 @@ nm_active_connection_set_state (NMActiveConnection *self, - && new_state >= NM_ACTIVE_CONNECTION_STATE_ACTIVATED && - priv->pending_activation_id) - { -- nm_device_remove_pending_action (priv->device, priv->pending_activation_id); -+ nm_device_remove_pending_action (priv->device, priv->pending_activation_id, TRUE); - g_clear_pointer (&priv->pending_activation_id, g_free); - } - } -@@ -399,7 +399,7 @@ nm_active_connection_set_device (NMActiveConnection *self, NMDevice *device) - - if (!priv->assumed) { - priv->pending_activation_id = g_strdup_printf ("activation::%p", (void *)self); -- nm_device_add_pending_action (device, priv->pending_activation_id); -+ nm_device_add_pending_action (device, priv->pending_activation_id, TRUE); - } - } - return TRUE; -@@ -540,7 +540,7 @@ nm_active_connection_set_assumed (NMActiveConnection *self, gboolean assumed) - priv->assumed = assumed; - - if (priv->pending_activation_id) { -- nm_device_remove_pending_action (priv->device, priv->pending_activation_id); -+ nm_device_remove_pending_action (priv->device, priv->pending_activation_id, TRUE); - g_clear_pointer (&priv->pending_activation_id, g_free); - } - } -@@ -795,7 +795,7 @@ _device_cleanup (NMActiveConnection *self) - } - - if (priv->pending_activation_id) { -- nm_device_remove_pending_action (priv->device, priv->pending_activation_id); -+ nm_device_remove_pending_action (priv->device, priv->pending_activation_id, TRUE); - g_clear_pointer (&priv->pending_activation_id, g_free); - } - -diff --git a/src/nm-policy.c b/src/nm-policy.c -index f569b75..b412427 100644 ---- a/src/nm-policy.c -+++ b/src/nm-policy.c -@@ -941,7 +941,7 @@ activate_data_free (ActivateData *data) - { - NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE (data->policy); - -- nm_device_remove_pending_action (data->device, "autoactivate"); -+ nm_device_remove_pending_action (data->device, "autoactivate", TRUE); - priv->pending_activation_checks = g_slist_remove (priv->pending_activation_checks, data); - - if (data->autoactivate_id) -@@ -1223,7 +1223,7 @@ schedule_activate_check (NMPolicy *policy, NMDevice *device) - return; - } - -- nm_device_add_pending_action (device, "autoactivate"); -+ nm_device_add_pending_action (device, "autoactivate", TRUE); - - data = g_malloc0 (sizeof (ActivateData)); - data->policy = policy; --- -1.9.0 - - -From e20f6c63b0a5f0dfb2851d6f5a098f8bb1f5a1be Mon Sep 17 00:00:00 2001 -From: Thomas Haller -Date: Mon, 14 Apr 2014 17:57:56 +0200 -Subject: [PATCH 2/2] core: wait with "startup complete" for both IPv4 and IPv6 - dynamic configuration - -In case of DHCP4, DHCP6 and/or SLAAC, delay "startup complete" until -both IPv4 and IPv6 are ready. This especially has an effect on -nm-online/NetworkManager-wait-online.service, which blocks until -configuration of both IPv4 and IPv6 is ready. - -We queue a pending_action when automatic configuration starts and -remove it again, when we receive an address. Before, "startup complete" -was reached when either one of the two IP protocols was configured. - -https://bugzilla.redhat.com/show_bug.cgi?id=1086906 - -Signed-off-by: Thomas Haller -(cherry picked from commit 516d66210fbcc9897f60dc9145a477e91ff8bad5) ---- - man/nm-online.1.in | 7 ++++++- - src/devices/nm-device.c | 28 ++++++++++++++++++++++++++++ - 2 files changed, 34 insertions(+), 1 deletion(-) - -diff --git a/man/nm-online.1.in b/man/nm-online.1.in -index 941f006..86ed974 100644 ---- a/man/nm-online.1.in -+++ b/man/nm-online.1.in -@@ -35,7 +35,12 @@ is a utility to find out whether we are online. It is done by asking - NetworkManager about its status. When run, \fInm\-online\fP waits until - NetworkManager reports an active connection, or specified timeout expires. On - exit, the returned status code should be checked (see the return codes bellow). -- -+.P -+By default NetworkManager waits for IPv4 dynamic addressing to complete but does -+not wait for the "auto" IPv6 dynamic addressing. To wait for IPv6 addressing to -+complete, either (1) change the network connection's IPv6 "may-fail" setting to "no", -+and/or (2) change the IPv6 addressing method to "manual" or "dhcp", to indicate that -+IPv6 connectivity is expected. - .SH OPTIONS - .TP - .B \-t, \-\-timeout -diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c -index b6e7ef2..8399cf6 100644 ---- a/src/devices/nm-device.c -+++ b/src/devices/nm-device.c -@@ -156,6 +156,10 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (NMDevice, nm_device, G_TYPE_OBJECT, - - #define NM_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE, NMDevicePrivate)) - -+#define PENDING_ACTION_DHCP4 "dhcp4" -+#define PENDING_ACTION_DHCP6 "dhcp6" -+#define PENDING_ACTION_AUTOCONF6 "autoconf6" -+ - typedef enum { - IP_NONE = 0, - IP_WAIT, -@@ -2820,6 +2824,8 @@ dhcp4_start (NMDevice *self, - G_CALLBACK (dhcp4_timeout), - self); - -+ nm_device_add_pending_action (self, PENDING_ACTION_DHCP4, TRUE); -+ - /* DHCP devices will be notified by the DHCP manager when stuff happens */ - return NM_ACT_STAGE_RETURN_POSTPONE; - } -@@ -3202,6 +3208,7 @@ dhcp6_start (NMDevice *self, - guint32 dhcp_opt, - NMDeviceStateReason *reason) - { -+ NMSettingIP6Config *s_ip6; - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - NMActStageReturn ret = NM_ACT_STAGE_RETURN_FAILURE; - guint8 *anycast = NULL; -@@ -3254,6 +3261,11 @@ dhcp6_start (NMDevice *self, - G_CALLBACK (dhcp6_timeout), - self); - -+ s_ip6 = nm_connection_get_setting_ip6_config (connection); -+ if (!nm_setting_ip6_config_get_may_fail (s_ip6) || -+ !strcmp (nm_setting_ip6_config_get_method (s_ip6), NM_SETTING_IP6_CONFIG_METHOD_DHCP)) -+ nm_device_add_pending_action (self, PENDING_ACTION_DHCP6, TRUE); -+ - /* DHCP devices will be notified by the DHCP manager when stuff happens */ - ret = NM_ACT_STAGE_RETURN_POSTPONE; - } else { -@@ -3620,6 +3632,9 @@ addrconf6_start (NMDevice *self, NMSettingIP6ConfigPrivacy use_tempaddr) - priv->rdisc_use_tempaddr = use_tempaddr; - print_support_extended_ifa_flags (use_tempaddr); - -+ if (!nm_setting_ip6_config_get_may_fail (nm_connection_get_setting_ip6_config (connection))) -+ nm_device_add_pending_action (self, PENDING_ACTION_AUTOCONF6, TRUE); -+ - /* ensure link local is ready... */ - ret = linklocal6_start (self); - if (ret == NM_ACT_STAGE_RETURN_SUCCESS) -@@ -3663,6 +3678,8 @@ addrconf6_cleanup (NMDevice *self) - priv->rdisc_config_changed_sigid = 0; - } - -+ nm_device_remove_pending_action (self, PENDING_ACTION_AUTOCONF6, FALSE); -+ - g_clear_object (&priv->ac_ip6_config); - g_clear_object (&priv->rdisc); - } -@@ -4509,6 +4526,9 @@ nm_device_activate_ip4_config_commit (gpointer user_data) - - /* Enter the IP_CHECK state if this is the first method to complete */ - priv->ip4_state = IP_DONE; -+ -+ nm_device_remove_pending_action (self, PENDING_ACTION_DHCP4, FALSE); -+ - if (nm_device_get_state (self) == NM_DEVICE_STATE_IP_CONFIG) - nm_device_state_changed (self, NM_DEVICE_STATE_IP_CHECK, NM_DEVICE_STATE_REASON_NONE); - -@@ -4598,6 +4618,10 @@ nm_device_activate_ip6_config_commit (gpointer user_data) - - /* Enter the IP_CHECK state if this is the first method to complete */ - priv->ip6_state = IP_DONE; -+ -+ nm_device_remove_pending_action (self, PENDING_ACTION_DHCP6, FALSE); -+ nm_device_remove_pending_action (self, PENDING_ACTION_AUTOCONF6, FALSE); -+ - if (nm_device_get_state (self) == NM_DEVICE_STATE_IP_CONFIG) - nm_device_state_changed (self, NM_DEVICE_STATE_IP_CHECK, NM_DEVICE_STATE_REASON_NONE); - } else { -@@ -4683,6 +4707,8 @@ dhcp4_cleanup (NMDevice *self, gboolean stop, gboolean release) - priv->dhcp4_timeout_sigid = 0; - } - -+ nm_device_remove_pending_action (self, PENDING_ACTION_DHCP4, FALSE); -+ - if (stop) - nm_dhcp_client_stop (priv->dhcp4_client, release); - -@@ -4720,6 +4746,8 @@ dhcp6_cleanup (NMDevice *self, gboolean stop, gboolean release) - priv->dhcp6_timeout_sigid = 0; - } - -+ nm_device_remove_pending_action (self, PENDING_ACTION_DHCP6, FALSE); -+ - if (stop) - nm_dhcp_client_stop (priv->dhcp6_client, release); - --- -1.9.0 - diff --git a/SOURCES/rh1100750-cli-vpn-types.patch b/SOURCES/rh1100750-cli-vpn-types.patch deleted file mode 100644 index 2819cd3..0000000 --- a/SOURCES/rh1100750-cli-vpn-types.patch +++ /dev/null @@ -1,149 +0,0 @@ -From 649e4be103589c5a137a582751a9ec84b12885e0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Mon, 26 May 2014 14:51:24 +0200 -Subject: [PATCH 1/2] cli: extract username and gateway for some more VPN - types -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - - -Signed-off-by: Jiří Klimeš ---- - cli/src/connections.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/cli/src/connections.c b/cli/src/connections.c -index 267d17c..295ca61 100644 ---- a/cli/src/connections.c -+++ b/cli/src/connections.c -@@ -939,6 +939,9 @@ find_vpn_gateway_key (const char *vpn_type) - if (g_strcmp0 (vpn_type, "pptp") == 0) return "gateway"; - if (g_strcmp0 (vpn_type, "openconnect") == 0) return "gateway"; - if (g_strcmp0 (vpn_type, "openswan") == 0) return "right"; -+ if (g_strcmp0 (vpn_type, "libreswan") == 0) return "right"; -+ if (g_strcmp0 (vpn_type, "ssh") == 0) return "remote"; -+ if (g_strcmp0 (vpn_type, "l2tp") == 0) return "gateway"; - return ""; - } - -@@ -950,6 +953,8 @@ find_vpn_username_key (const char *vpn_type) - if (g_strcmp0 (vpn_type, "pptp") == 0) return "user"; - if (g_strcmp0 (vpn_type, "openconnect") == 0) return "username"; - if (g_strcmp0 (vpn_type, "openswan") == 0) return "leftxauthusername"; -+ if (g_strcmp0 (vpn_type, "libreswan") == 0) return "leftxauthusername"; -+ if (g_strcmp0 (vpn_type, "l2tp") == 0) return "user"; - return ""; - } - --- -1.7.11.7 - - -From d7216505bbfe0de976d477609c06528432c380d4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Mon, 26 May 2014 15:19:47 +0200 -Subject: [PATCH 2/2] cli: do not restrict VPN type of created connections (rh - #1100750) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -There may be third-party VPN plugins nmcli is not aware of. -We still print a warning if nmcli doesn't know the type. It helps to catch up -typos. - -https://bugzilla.redhat.com/show_bug.cgi?id=1100750 - -Signed-off-by: Jiří Klimeš ---- - cli/completion/nmcli | 2 +- - cli/src/connections.c | 20 +++++++++----------- - man/nmcli.1.in | 2 +- - 3 files changed, 11 insertions(+), 13 deletions(-) - -diff --git a/cli/completion/nmcli b/cli/completion/nmcli -index bbfee3a..0a185a1 100644 ---- a/cli/completion/nmcli -+++ b/cli/completion/nmcli -@@ -419,7 +419,7 @@ _nmcli_compl_ARGS() - ;; - vpn-type) - if [[ "${#words[@]}" -eq 2 ]]; then -- _nmcli_list "vpnc openvpn pptp openconnect openswan" -+ _nmcli_list "vpnc openvpn pptp openconnect openswan libreswan ssh l2tp iodine" - return 0 - fi - ;; -diff --git a/cli/src/connections.c b/cli/src/connections.c -index 295ca61..3580c79 100644 ---- a/cli/src/connections.c -+++ b/cli/src/connections.c -@@ -400,7 +400,7 @@ usage_connection_add (void) - " [priority <0-63>]\n" - " [path-cost <1-65535>]\n" - " [hairpin yes|no]\n\n" -- " vpn: vpn-type vpnc|openvpn|pptp|openconnect|openswan\n" -+ " vpn: vpn-type vpnc|openvpn|pptp|openconnect|openswan|libreswan|ssh|l2tp|iodine|...\n" - " [user ]\n\n" - " olpc-mesh: ssid \n" - " [channel <1-13>]\n" -@@ -4758,14 +4758,14 @@ cleanup_bridge_slave: - } else if (!strcmp (con_type, NM_SETTING_VPN_SETTING_NAME)) { - /* Build up the settings required for 'vpn' */ - gboolean success = FALSE; -- const char *valid_vpns[] = { "openvpn", "vpnc", "pptp", "openconnect", "openswan", NULL }; -+ const char *known_vpns[] = { "openvpn", "vpnc", "pptp", "openconnect", "openswan", "libreswan", -+ "ssh", "l2tp", "iodine", NULL }; - const char *vpn_type = NULL; - char *vpn_type_ask = NULL; - const char *user_c = NULL; - char *user = NULL; - const char *st; - char *service_type = NULL; -- GError *tmp_err = NULL; - nmc_arg_t exp_args[] = { {"vpn-type", TRUE, &vpn_type, !ask}, - {"user", TRUE, &user_c, FALSE}, - {NULL} }; -@@ -4781,19 +4781,17 @@ cleanup_bridge_slave: - goto cleanup_vpn; - } - -+ if (!(st = nmc_string_is_valid (vpn_type, known_vpns, NULL))) { -+ printf (_("Warning: 'vpn-type': %s not known.\n"), vpn_type); -+ st = vpn_type; -+ } -+ service_type = g_strdup_printf ("%s.%s", NM_DBUS_INTERFACE, st); -+ - /* Also ask for all optional arguments if '--ask' is specified. */ - user = user_c ? g_strdup (user_c) : NULL; - if (ask) - do_questionnaire_vpn (&user); - -- if (!(st = nmc_string_is_valid (vpn_type, valid_vpns, &tmp_err))) { -- g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, -- _("Error: 'vpn-type': %s."), tmp_err->message); -- g_clear_error (&tmp_err); -- goto cleanup_vpn; -- } -- service_type = g_strdup_printf ("%s.%s", NM_DBUS_INTERFACE, st); -- - /* Add 'vpn' setting */ - s_vpn = (NMSettingVPN *) nm_setting_vpn_new (); - nm_connection_add_setting (connection, NM_SETTING (s_vpn)); -diff --git a/man/nmcli.1.in b/man/nmcli.1.in -index 6eb6f1f..1d91e89 100644 ---- a/man/nmcli.1.in -+++ b/man/nmcli.1.in -@@ -573,7 +573,7 @@ to be sent back out through the slave the frame was received on (default: yes) - .RS - .TP - .B vpn: --.IP "\fIvpn-type vpnc|openvpn|pptp|openconnect|openswan\fP" 42 -+.IP "\fIvpn-type vpnc|openvpn|pptp|openconnect|openswan|libreswan|ssh|l2tp|iodine|...\fP" 42 - \(en VPN type - .IP "\fI[user ]\fP" 42 - \(en VPN username --- -1.7.11.7 - diff --git a/SOURCES/rh1103702-tui-ipv6-addr-crash-fix.patch b/SOURCES/rh1103702-tui-ipv6-addr-crash-fix.patch deleted file mode 100644 index c1b0650..0000000 --- a/SOURCES/rh1103702-tui-ipv6-addr-crash-fix.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 5378d7929eac07d55d5aa128ed21d6c03b14acf2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Mon, 2 Jun 2014 14:32:18 +0200 -Subject: [PATCH 1/2] tui: fix a crash when editing an IPv6 address (rh - #1103702) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1103702 - -Signed-off-by: Jiří Klimeš ---- - tui/nm-editor-bindings.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tui/nm-editor-bindings.c b/tui/nm-editor-bindings.c -index 44c9ec9..58346cd 100644 ---- a/tui/nm-editor-bindings.c -+++ b/tui/nm-editor-bindings.c -@@ -671,7 +671,7 @@ ip6_addresses_with_prefix_from_strv (GBinding *binding, - NULL); - - for (i = 0; strings[i]; i++) { -- if (i > addrs->len) { -+ if (i >= addrs->len) { - addr = g_value_array_new (3); - - g_value_init (&val, DBUS_TYPE_G_UCHAR_ARRAY); --- -1.7.11.7 - - -From d7b8aeea335498771bc66faae0cbd938b02ce84a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Mon, 2 Jun 2014 14:36:16 +0200 -Subject: [PATCH 2/2] tui: use 128 as the default prefix for IPv6 addresses -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - - -Signed-off-by: Jiří Klimeš ---- - tui/nm-editor-bindings.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/tui/nm-editor-bindings.c b/tui/nm-editor-bindings.c -index 58346cd..7f76f14 100644 ---- a/tui/nm-editor-bindings.c -+++ b/tui/nm-editor-bindings.c -@@ -104,8 +104,12 @@ ip_string_parse (const char *text, - || (family == AF_INET && *prefix > 32) - || (family == AF_INET6 && *prefix > 128)) - valid = FALSE; -- } else if (prefix) -- *prefix = 32; -+ } else if (prefix) { -+ if (family == AF_INET) -+ *prefix = 32; -+ else -+ *prefix = 128; -+ } - - return valid; - } --- -1.7.11.7 - diff --git a/SOURCES/rh1103702-tui-ipv6-route-crash-fix.patch b/SOURCES/rh1103702-tui-ipv6-route-crash-fix.patch deleted file mode 100644 index c315f2e..0000000 --- a/SOURCES/rh1103702-tui-ipv6-route-crash-fix.patch +++ /dev/null @@ -1,256 +0,0 @@ -From 92898e84d6aebc3ab11799476d7ab8c0d1627949 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Tue, 3 Jun 2014 12:38:07 +0200 -Subject: [PATCH 1/3] tui: fix a crash when editing IPv6 routes -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - - -Signed-off-by: Jiří Klimeš ---- - tui/nm-editor-bindings.c | 14 +++++++------- - tui/nmt-route-entry.c | 2 +- - 2 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/tui/nm-editor-bindings.c b/tui/nm-editor-bindings.c -index 7f76f14..5be1358 100644 ---- a/tui/nm-editor-bindings.c -+++ b/tui/nm-editor-bindings.c -@@ -772,7 +772,7 @@ ip6_addresses_to_strv (GBinding *binding, - for (i = 0; i < addrs->len; i++) { - addrbytes = addrs->pdata[i]; - if (IP6_ADDRESS_SET (addrbytes)) -- inet_ntop (AF_INET, addrbytes->data, buf, sizeof (buf)); -+ inet_ntop (AF_INET6, addrbytes->data, buf, sizeof (buf)); - else - buf[0] = '\0'; - strings[i] = g_strdup (buf); -@@ -1002,7 +1002,7 @@ ip6_route_transform_to_next_hop_string (GBinding *binding, - addrbytes = &in6addr_any; - - if (IN6_ADDR_SET (addrbytes)) -- inet_ntop (AF_INET, &addrbytes, buf, sizeof (buf)); -+ inet_ntop (AF_INET6, addrbytes, buf, sizeof (buf)); - else - buf[0] = '\0'; - g_value_set_string (target_value, buf); -@@ -1035,7 +1035,7 @@ ip6_route_transform_from_dest_string (GBinding *binding, - { - NMIP6Route *route; - const char *text; -- const struct in6_addr *addrbytes; -+ struct in6_addr addrbytes; - guint32 prefix; - - text = g_value_get_string (source_value); -@@ -1047,7 +1047,7 @@ ip6_route_transform_from_dest_string (GBinding *binding, - g_binding_get_source_property (binding), &route, - NULL); - -- nm_ip6_route_set_dest (route, addrbytes); -+ nm_ip6_route_set_dest (route, &addrbytes); - nm_ip6_route_set_prefix (route, prefix); - - g_value_take_boxed (target_value, route); -@@ -1062,21 +1062,21 @@ ip6_route_transform_from_next_hop_string (GBinding *binding, - { - NMIP6Route *route; - const char *text; -- const struct in6_addr *addrbytes; -+ struct in6_addr addrbytes; - - text = g_value_get_string (source_value); - if (*text) { - if (!ip_string_parse (text, AF_INET6, &addrbytes, NULL)) - return FALSE; - } else -- addrbytes = 0; -+ addrbytes = in6addr_any; - - /* Fetch the original property value */ - g_object_get (g_binding_get_source (binding), - g_binding_get_source_property (binding), &route, - NULL); - -- nm_ip6_route_set_next_hop (route, addrbytes); -+ nm_ip6_route_set_next_hop (route, &addrbytes); - - g_value_take_boxed (target_value, route); - return TRUE; -diff --git a/tui/nmt-route-entry.c b/tui/nmt-route-entry.c -index db8c254..1b20ca6 100644 ---- a/tui/nmt-route-entry.c -+++ b/tui/nmt-route-entry.c -@@ -206,7 +206,7 @@ nmt_route_entry_set_property (GObject *object, - priv->ip4_route = g_value_dup_boxed (value); - break; - case PROP_IP6_ROUTE: -- g_return_if_fail (priv->family == AF_INET); -+ g_return_if_fail (priv->family == AF_INET6); - if (priv->ip6_route) - nm_ip6_route_unref (priv->ip6_route); - priv->ip6_route = g_value_dup_boxed (value); --- -1.7.11.7 - - -From 5ee85fe46e86fdc9e063c22700697802435503a6 Mon Sep 17 00:00:00 2001 -From: Dan Winship -Date: Tue, 3 Jun 2014 09:13:43 -0400 -Subject: [PATCH 2/3] tui: fix setting Clone MAC Address properties -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -NmtMacEntry wasn't notifying its mac-address property when it changed, -so the change never got saved to the NMSetting. - -https://bugzilla.gnome.org/show_bug.cgi?id=731160 - -Signed-off-by: Jiří Klimeš ---- - tui/nmt-mac-entry.c | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/tui/nmt-mac-entry.c b/tui/nmt-mac-entry.c -index d76c097..b065640 100644 ---- a/tui/nmt-mac-entry.c -+++ b/tui/nmt-mac-entry.c -@@ -28,6 +28,8 @@ - - #include "config.h" - -+#include -+ - #include - #include - -@@ -129,6 +131,17 @@ nmt_mac_entry_init (NmtMacEntry *entry) - } - - static void -+nmt_mac_entry_notify (GObject *object, -+ GParamSpec *pspec) -+{ -+ if (G_OBJECT_CLASS (nmt_mac_entry_parent_class)->notify) -+ G_OBJECT_CLASS (nmt_mac_entry_parent_class)->notify (object, pspec); -+ -+ if (pspec->owner_type == NMT_TYPE_NEWT_ENTRY && !strcmp (pspec->name, "text")) -+ g_object_notify (object, "mac-address"); -+} -+ -+static void - nmt_mac_entry_set_property (GObject *object, - guint prop_id, - const GValue *value, -@@ -189,6 +202,7 @@ nmt_mac_entry_class_init (NmtMacEntryClass *entry_class) - g_type_class_add_private (entry_class, sizeof (NmtMacEntryPrivate)); - - /* virtual methods */ -+ object_class->notify = nmt_mac_entry_notify; - object_class->set_property = nmt_mac_entry_set_property; - object_class->get_property = nmt_mac_entry_get_property; - --- -1.7.11.7 - - -From d57795d474aaae7865d4d052605d5ddec65c429d Mon Sep 17 00:00:00 2001 -From: Dan Winship -Date: Tue, 3 Jun 2014 09:36:17 -0400 -Subject: [PATCH 3/3] tui: fix NmtMacEntry validation/display -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -NmtMacEntry would allow you to input 1 character more than it should -have. Fix that. - -Also, the code to insert ":"s automatically was bumping against some -weirdness in NmtNewtEntry that made it so that the ":" didn't get -displayed until you typed one more character after the one where it -got inserted. Hack around that by manually requesting a redraw. - -https://bugzilla.gnome.org/show_bug.cgi?id=731160 - -Signed-off-by: Jiří Klimeš ---- - tui/nmt-mac-entry.c | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - -diff --git a/tui/nmt-mac-entry.c b/tui/nmt-mac-entry.c -index b065640..5e1c417 100644 ---- a/tui/nmt-mac-entry.c -+++ b/tui/nmt-mac-entry.c -@@ -82,7 +82,7 @@ mac_filter (NmtNewtEntry *entry, - { - NmtMacEntryPrivate *priv = NMT_MAC_ENTRY_GET_PRIVATE (entry); - -- if (position > priv->mac_str_length) -+ if (position >= priv->mac_str_length) - return FALSE; - - return g_ascii_isxdigit (ch) || ch == ':'; -@@ -116,8 +116,13 @@ mac_validator (NmtNewtEntry *entry, - if (g_ascii_isxdigit (p[0]) && !p[1]) { - char *fixed = g_strdup_printf ("%.*s:%c", (int)(p - text), text, *p); - -- g_object_set (G_OBJECT (entry), "text", fixed, NULL); -- return TRUE; -+ nmt_newt_entry_set_text (entry, fixed); -+ g_free (fixed); -+ -+ /* FIXME: NmtNewtEntry doesn't correctly deal with us calling set_text() -+ * from inside the validator. -+ */ -+ nmt_newt_widget_needs_rebuild (NMT_NEWT_WIDGET (entry)); - } - - return FALSE; --- -1.7.11.7 - -From 7f5b2f81b0b4bf86a0086d4004461e4d1bc95950 Mon Sep 17 00:00:00 2001 -From: Dan Winship -Date: Fri, 25 Apr 2014 11:01:21 -0400 -Subject: [PATCH] tui: fix route editing (rh #1090422) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -NmtRouteTable's ip4-routes and ip6-routes properties have the -D-Bus-based route list types (like the corresponding NMSetting -properties) so we have to convert our GSList-of-NMIP[46]Route data -into those types when updating the property. - -https://bugzilla.gnome.org/show_bug.cgi?id=728958 - -Signed-off-by: Jiří Klimeš ---- - tui/nmt-route-table.c | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/tui/nmt-route-table.c b/tui/nmt-route-table.c -index 75b2b67..d6173a0 100644 ---- a/tui/nmt-route-table.c -+++ b/tui/nmt-route-table.c -@@ -119,7 +119,14 @@ route_list_transform_from_route (GBinding *binding, - nm_ip6_route_unref (nth->data); - } - nth->data = g_value_dup_boxed (source_value); -- g_value_take_boxed (target_value, routes); -+ -+ if (priv->family == AF_INET) { -+ nm_utils_ip4_routes_to_gvalue (routes, target_value); -+ g_slist_free_full (routes, (GDestroyNotify) nm_ip4_route_unref); -+ } else if (priv->family == AF_INET6) { -+ nm_utils_ip6_routes_to_gvalue (routes, target_value); -+ g_slist_free_full (routes, (GDestroyNotify) nm_ip6_route_unref); -+ } - - return TRUE; - } --- -1.7.11.7 - diff --git a/SOURCES/rh799241-dcb-carrier-fixes.patch b/SOURCES/rh799241-dcb-carrier-fixes.patch deleted file mode 100644 index 58672de..0000000 --- a/SOURCES/rh799241-dcb-carrier-fixes.patch +++ /dev/null @@ -1,832 +0,0 @@ -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/SPECS/NetworkManager.spec b/SPECS/NetworkManager.spec index 5441714..4e1b5c9 100644 --- a/SPECS/NetworkManager.spec +++ b/SPECS/NetworkManager.spec @@ -1,68 +1,88 @@ %define dbus_version 1.1 -%define dbus_glib_version 0.94 +%define dbus_glib_version 0.100 -%define glib2_version 2.24.0 +%define glib2_version 2.32.0 %define wireless_tools_version 1:28-0pre9 -%define libnl3_version 3.2.7 -%define ppp_version 2.4.5 +%define libnl3_version 3.2.21-7 -%define snapshot .git20140326 -%define git_sha .4dba720 -%define realversion 0.9.9.1 +%define ppp_version %(rpm -q ppp-devel >/dev/null && rpm -q --qf '%%{version}' ppp-devel || echo -n bad) + +%define snapshot .git20150121 +%define git_sha b4ea599c +%define realversion 1.0.0 +%define release_version 14 +%define epoch_version 1 + +%define obsoletes_nmver 1:1.0.0-1 %global with_nmtui 1 -%global regen_docs 0 +%if 0%{?fedora} +%global regen_docs 1 +%else +%global regen_docs 1 +%endif %define systemd_dir %{_prefix}/lib/systemd/system %define udev_dir %{_prefix}/lib/udev -%if 0%{?rhel} || (0%{?fedora} > 19) -%global with_teamctl 1 +%global with_adsl 1 +%global with_bluetooth 1 +%global with_team 1 +%global with_wifi 1 +%global with_wimax 0 +%global with_wwan 1 + +# WiMAX still supported on <= F19 +%if ! 0%{?rhel} && (! 0%{?fedora} || 0%{?fedora} < 20) +%global with_wimax 1 +%endif + +# ModemManager on Fedora < 20 too old for Bluetooth && wwan +%if (0%{?fedora} && 0%{?fedora} < 20) +%global with_bluetooth 0 +%global with_wwan 0 +%endif + +# Bluetooth requires the WWAN plugin +%if 0%{?with_bluetooth} +%global with_wwan 1 %endif +%if (0%{?fedora} && 0%{?fedora} <= 19) +%global with_team 0 +%endif + +%define with_modem_manager_1 0 +%if 0%{?with_bluetooth} || (0%{?with_wwan} && (0%{?rhel} || (0%{?fedora} && 0%{?fedora} > 19))) +%define with_modem_manager_1 1 +%endif %global _hardened_build 1 +%define git_sha_version %(test -n '%{git_sha}' && echo '.%{git_sha}') + Name: NetworkManager Summary: Network connection manager and user applications -Epoch: 1 +Epoch: %{epoch_version} Version: %{realversion} -Release: 29%{snapshot}%{?git_sha}%{?dist} +Release: %{release_version}%{snapshot}%{git_sha_version}%{?dist} Group: System Environment/Base License: GPLv2+ URL: http://www.gnome.org/projects/NetworkManager/ -Source: %{name}-%{realversion}%{snapshot}%{git_sha}.tar.bz2 +Source: %{name}-%{realversion}%{snapshot}%{git_sha_version}.tar.bz2 Source1: NetworkManager.conf Source2: 00-server.conf -Source3: README.nmcs +Source3: 10-ibft-plugin.conf +Source4: 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 -Patch9: rh1083153-ignore-cloned-routes.patch -Patch10: rh1091296-dispatch-lease-change.patch -Patch11: rh1086237-ipv6-route-matching.patch -Patch12: rh1096063-NM-w-o-for-IPv4-and-IPv6.patch -Patch13: rh1100750-cli-vpn-types.patch -Patch14: rh1083196-match-connections-and-s390.patch -Patch15: rh1086237-dhcpv6-addr-lifetime.patch -Patch16: rh1067712-connection-order-fix.patch -Patch17: rh1083196-ipv6-method-ignore-auto.patch -Patch18: rh1103702-tui-ipv6-addr-crash-fix.patch -Patch19: rh1103702-tui-ipv6-route-crash-fix.patch -Patch20: 0020-rh1103782-firewall-zone-conflict.patch -Patch21: 0021-rh1108167-nm-crash-on-device-removal.patch -Patch22: 0022-rh1112020-crash-reading-bridge-sysctl.patch -Patch23: 0023-rh1093231-mtu-fix.patch -#Patch24: 0024-rh1083133-rh1098319-nm-ipv6ll.patch -Patch25: 0025-rh1149996-ifcfg-rh-GATEWAY.patch -Patch26: 0026-rh1139326-address-lifetime-dhcp-expiry.patch +Patch2: 0002-rh1184923-teamd.patch +Patch3: 0003-rh1160013-rules.patch +Patch4: 0004-bridge-route-metric.patch +Patch5: 0005-schedule-early-config.patch +Patch6: 0006-rh1184997-ip6ll-flush.patch +Patch7: 0007-rh1160013-rules-subpackage.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -80,15 +100,19 @@ Requires: dbus-glib >= %{dbus_glib_version} Requires: glib2 >= %{glib2_version} Requires: iproute Requires: dhclient >= 12:4.1.0 -Requires: wpa_supplicant >= 1:0.7.3-1 Requires: libnl3 >= %{libnl3_version} -Requires: %{name}-glib%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-libnm%{?_isa} = %{epoch}:%{version}-%{release} Requires: ppp = %{ppp_version} Requires: avahi-autoipd Requires: dnsmasq Requires: udev Requires: iptables +Requires: readline Obsoletes: dhcdbd +Obsoletes: NetworkManager < %{obsoletes_nmver} + +# Kept for RHEL to ensure that wired 802.1x works out of the box +Requires: wpa_supplicant >= 1:1.1 Conflicts: NetworkManager-vpnc < 1:0.7.0.99-1 Conflicts: NetworkManager-openvpn < 1:0.7.0.99-1 @@ -106,47 +130,136 @@ BuildRequires: gobject-introspection-devel >= 0.10.3 BuildRequires: gettext-devel BuildRequires: /usr/bin/autopoint BuildRequires: pkgconfig -BuildRequires: wpa_supplicant BuildRequires: libnl3-devel >= %{libnl3_version} BuildRequires: perl(XML::Parser) +BuildRequires: perl(YAML) BuildRequires: automake autoconf intltool libtool -BuildRequires: ppp = %{ppp_version} -BuildRequires: ppp-devel = %{ppp_version} +BuildRequires: ppp-devel >= 2.4.5 BuildRequires: nss-devel >= 3.11.7 -BuildRequires: polkit-devel BuildRequires: dhclient +BuildRequires: readline-devel %if %{regen_docs} BuildRequires: gtk-doc %endif BuildRequires: libudev-devel BuildRequires: libuuid-devel BuildRequires: libgudev1-devel >= 143 -BuildRequires: libselinux-devel BuildRequires: vala-tools BuildRequires: iptables +%if 0%{?with_bluetooth} && 0%{?fedora} > 19 +BuildRequires: bluez-libs-devel +%endif +%if 0%{?with_wimax} +BuildRequires: wimax-devel +%endif BuildRequires: systemd >= 200-3 systemd-devel BuildRequires: libsoup-devel BuildRequires: libndp-devel >= 1.0 -%if 0%{?rhel} || (0%{?fedora} && 0%{?fedora} > 19) +%if 0%{?with_modem_manager_1} BuildRequires: ModemManager-glib-devel >= 1.0 %endif %if 0%{?with_nmtui} BuildRequires: newt-devel %endif -%if 0%{?with_teamctl} +BuildRequires: /usr/bin/dbus-launch +BuildRequires: pygobject3-base +BuildRequires: dbus-python +BuildRequires: libselinux-devel +BuildRequires: polkit-devel + + +%description +NetworkManager is a system service that manages network interfaces and +connections based on user or automatic configuration. It supports +Ethernet, Bridge, Bond, VLAN, Team, InfiniBand, Wi-Fi, mobile broadband +(WWAN), PPPoE and other devices, and supports a variety of different VPN +services. + + +%if 0%{?with_adsl} +%package adsl +Summary: ADSL device plugin for NetworkManager +Group: System Environment/Base +Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} +Obsoletes: NetworkManager < %{obsoletes_nmver} +Obsoletes: NetworkManager-atm + +%description adsl +This package contains NetworkManager support for ADSL devices. +%endif + + +%if 0%{?with_bluetooth} +%package bluetooth +Summary: Bluetooth device plugin for NetworkManager +Group: System Environment/Base +Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} +Requires: NetworkManager-wwan = %{epoch}:%{version}-%{release} +# No Requires:bluez to prevent it being installed when updating +# to the split NM package +Obsoletes: NetworkManager < %{obsoletes_nmver} +Obsoletes: NetworkManager-bt + +%description bluetooth +This package contains NetworkManager support for Bluetooth devices. +%endif + + +%if 0%{?with_team} +%package team +Summary: Team device plugin for NetworkManager +Group: System Environment/Base BuildRequires: teamd-devel +Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} +Obsoletes: NetworkManager < %{obsoletes_nmver} + +%description team +This package contains NetworkManager support for team devices. %endif -%description -NetworkManager is a system network service that manages your network devices -and connections, attempting to keep active network connectivity when available. -It manages ethernet, WiFi, mobile broadband (WWAN), and PPPoE devices, and -provides VPN integration with a variety of different VPN services. +%if 0%{?with_wifi} +%package wifi +Summary: Wifi plugin for NetworkManager +Group: System Environment/Base +Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} +Requires: wpa_supplicant >= 1:1.1 +Obsoletes: NetworkManager < %{obsoletes_nmver} + +%description wifi +This package contains NetworkManager support for Wifi and OLPC devices. +%endif + + +%if 0%{?with_wwan} +%package wwan +Summary: Mobile broadband device plugin for NetworkManager +Group: System Environment/Base +Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} +# No Requires:ModemManager to prevent it being installed when updating +# to the split NM package +Obsoletes: NetworkManager < %{obsoletes_nmver} + +%description wwan +This package contains NetworkManager support for mobile broadband (WWAN) devices. +%endif + + +%if 0%{?with_wimax} +%package wimax +Summary: Intel WiMAX device support for NetworkManager +Group: System Environment/Base +Requires: wimax +Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} + +%description wimax +This package contains NetworkManager support for Intel WiMAX mobile broadband +devices. +%endif %package devel -Summary: Libraries and headers for adding NetworkManager support to applications +Summary: Headers defining the NetworkManager D-Bus APIs Group: Development/Libraries Requires: %{name} = %{epoch}:%{version}-%{release} Requires: dbus-devel >= %{dbus_version} @@ -159,18 +272,19 @@ from applications. %package glib -Summary: Libraries for adding NetworkManager support to applications that use glib. +Summary: Libraries for adding NetworkManager support to applications (old API). Group: Development/Libraries Requires: dbus >= %{dbus_version} Requires: dbus-glib >= %{dbus_glib_version} %description glib This package contains the libraries that make it easier to use some NetworkManager -functionality from applications that use glib. +functionality from applications that use glib. This is the older NetworkManager API. +See also NetworkManager-libnm. %package glib-devel -Summary: Header files for adding NetworkManager support to applications that use glib. +Summary: Header files for adding NetworkManager support to applications (old API). Group: Development/Libraries Requires: %{name}-devel%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}-glib%{?_isa} = %{epoch}:%{version}-%{release} @@ -180,7 +294,33 @@ Requires: dbus-glib-devel >= %{dbus_glib_version} %description glib-devel This package contains the header and pkg-config files for development applications using -NetworkManager functionality from applications that use glib. +NetworkManager functionality from applications that use glib. This is the older +NetworkManager API. See also NetworkManager-libnm-devel. + + +%package libnm +Summary: Libraries for adding NetworkManager support to applications (new API). +Group: Development/Libraries +Conflicts: NetworkManager-glib < %{obsoletes_nmver} + +%description libnm +This package contains the libraries that make it easier to use some NetworkManager +functionality from applications. This is the new NetworkManager API. See also +NetworkManager-glib. + + +%package libnm-devel +Summary: Header files for adding NetworkManager support to applications (new API). +Group: Development/Libraries +Requires: %{name}-devel%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-libnm%{?_isa} = %{epoch}:%{version}-%{release} +Requires: glib2-devel +Requires: pkgconfig + +%description libnm-devel +This package contains the header and pkg-config files for development applications using +NetworkManager functionality from applications. This is the new NetworkManager API. +See also NetworkManager-glib-devel. %package config-server Summary: NetworkManager config file for "server-like" defaults @@ -196,12 +336,22 @@ ethernet devices with no carrier. This package is intended to be installed by default for server deployments. +%package config-routing-rules +Summary: NetworkManager config file for advanced routing rules +Group: System Environment/Base + +%description config-routing-rules +This adds a NetworkManager configuration file to support networking +configurations using "/etc/sysconfig/network-scripts/rule-NAME" files +(eg, to do policy-based routing). + %if 0%{with_nmtui} %package tui Summary: NetworkManager curses-based UI Group: System Environment/Base Requires: %{name} = %{epoch}:%{version}-%{release} -Requires: %{name}-glib%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-libnm%{?_isa} = %{epoch}:%{version}-%{release} + %description tui This adds a curses-based "TUI" (Text User Interface) to @@ -213,31 +363,12 @@ by nm-connection-editor and nm-applet in a non-graphical environment. %setup -q -n NetworkManager-%{realversion} %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 -%patch9 -p1 -b .rh1083153-ignore-cloned-routes -%patch10 -p1 -b .rh1091296-dispatch-lease-change -%patch11 -p1 -b .rh1086237-ipv6-route-matching -%patch12 -p1 -b .0012.rh1096063-NM-w-o-for-IPv4-and-IPv6.orig -%patch13 -p1 -b .rh1100750-cli-vpn-types -%patch14 -p1 -b .rh1083196-match-connections-and-s390 -%patch15 -p1 -b .rh1086237-dhcpv6-addr-lifetime -%patch16 -p1 -b .rh1067712-connection-order-fix -%patch17 -p1 -b .rh1083196-ipv6-method-ignore-auto -%patch18 -p1 -b .rh1103702-tui-ipv6-addr-crash-fix -%patch19 -p1 -b .rh1103702-tui-ipv6-route-crash-fix -%patch20 -p1 -b .0020.rh1103782-firewall-zone-conflict.orig -%patch21 -p1 -b .0021-rh1108167-nm-crash-on-device-removal.orig -%patch22 -p1 -b .0022-rh1112020-crash-reading-bridge-sysctl.orig -%patch23 -p1 -b .0023-rh1093231-mtu-fix.orig -#%patch24 -p1 -b .0024-rh1083133-rh1098319-nm-ipv6ll.orig -%patch25 -p1 -b .0025-rh1149996-ifcfg-rh-GATEWAY.orig -%patch26 -p1 -b .0026-rh1139326-address-lifetime-padding.orig +%patch2 -p1 -b .0002.rh1184923.teamd.orig +%patch3 -p1 -b .0003.rh1160013.rules.orig +%patch4 -p1 -b .0004-bridge-route-metric.orig +%patch5 -p1 -b .0005-schedule-early-config.orig +%patch6 -p1 -b .0006-rh1184997-ip6ll-flush.orig +%patch7 -p1 -b .0007.rh1160013.rules-subpackage.orig %build @@ -257,28 +388,35 @@ intltoolize --force --with-crypto=nss \ --enable-more-warnings=error \ --enable-ppp=yes \ -%if 0%{?rhel} || (0%{?fedora} > 19) +%if 0%{?with_modem_manager_1} --with-modem-manager-1=yes \ %else --with-modem-manager-1=no \ %endif +%if 0%{?with_wimax} + --enable-wimax=yes \ +%else --enable-wimax=no \ +%endif --enable-vala=yes \ %if 0%{?regen_docs} --enable-gtk-doc \ +%else + --disable-gtk-doc \ %endif %if 0%{?fedora} --with-wext=yes \ %else --with-wext=no \ %endif -%if 0%{?with_teamctl} - --enable-teamctl=yes \ +%if 0%{?with_team} + --enable-teamdctl=yes \ %else - --enable-teamctl=no \ + --enable-teamdctl=no \ %endif - --enable-polkit=yes \ --with-selinux=yes \ + --enable-polkit=yes \ + --enable-polkit-agent \ --enable-modify-system=yes \ --enable-concheck \ --with-session-tracking=systemd \ @@ -291,7 +429,8 @@ intltoolize --force --enable-ifcfg-rh=yes \ --with-system-libndp=yes \ --with-pppd-plugin-dir=%{_libdir}/pppd/%{ppp_version} \ - --with-dist-version=%{version}-%{release} + --with-dist-version=%{version}-%{release} \ + --with-setting-plugins-default='ifcfg-rh,ibft' make %{?_smp_mflags} @@ -305,8 +444,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} . +%{__cp} %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.d +%{__cp} %{SOURCE4} . # create a VPN directory %{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/VPN @@ -317,6 +456,13 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.d # create a dnsmasq.d directory %{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dnsmasq.d +# create dispatcher directories +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/dispatcher.d +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/dispatcher.d/pre-up.d +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/dispatcher.d/pre-down.d +install examples/dispatcher/10-ifcfg-rh-routes.sh $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/dispatcher.d/ +ln $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/10-ifcfg-rh-routes.sh $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/dispatcher.d/pre-up.d/ + %{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/gnome-vpn-properties %{__mkdir_p} $RPM_BUILD_ROOT%{_localstatedir}/lib/NetworkManager @@ -327,17 +473,12 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.d %{__rm} -f $RPM_BUILD_ROOT%{_libdir}/pppd/%{ppp_version}/*.la %{__rm} -f $RPM_BUILD_ROOT%{_libdir}/NetworkManager/*.la -install -m 0755 test/.libs/nm-online %{buildroot}/%{_bindir} - %if %{regen_docs} # install the pristine docs %{__cp} ORIG-docs/libnm-glib/html/* $RPM_BUILD_ROOT%{_datadir}/gtk-doc/html/libnm-glib/ %{__cp} ORIG-docs/libnm-util/html/* $RPM_BUILD_ROOT%{_datadir}/gtk-doc/html/libnm-util/ %endif -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 - %clean %{__rm} -rf $RPM_BUILD_ROOT @@ -375,17 +516,22 @@ fi %{_datadir}/bash-completion/completions/nmcli %dir %{_sysconfdir}/%{name}/ %dir %{_sysconfdir}/%{name}/dispatcher.d +%dir %{_sysconfdir}/%{name}/dispatcher.d/pre-down.d +%dir %{_sysconfdir}/%{name}/dispatcher.d/pre-up.d %dir %{_sysconfdir}/%{name}/dnsmasq.d %dir %{_sysconfdir}/%{name}/VPN %config(noreplace) %{_sysconfdir}/%{name}/NetworkManager.conf %{_bindir}/nm-online %{_libexecdir}/nm-dhcp-helper %{_libexecdir}/nm-avahi-autoipd.action -%{_libexecdir}/nm-dispatcher.action +%{_libexecdir}/nm-dispatcher +%{_libexecdir}/nm-iface-helper %dir %{_libdir}/NetworkManager %{_libdir}/NetworkManager/libnm-settings-plugin*.so -%{_libdir}/NetworkManager/libnm-device-plugin*.so -%{_libdir}/NetworkManager/libnm-wwan.so +%if 0%{?with_nmtui} +%exclude %{_mandir}/man1/nmtui* +%endif +%config %{_sysconfdir}/%{name}/conf.d/10-ibft-plugin.conf %{_mandir}/man1/* %{_mandir}/man5/* %{_mandir}/man8/* @@ -401,8 +547,50 @@ fi %{systemd_dir}/NetworkManager-wait-online.service %{systemd_dir}/NetworkManager-dispatcher.service %{systemd_dir}/network-online.target.wants/NetworkManager-wait-online.service +%dir %{_datadir}/doc/NetworkManager/examples %{_datadir}/doc/NetworkManager/examples/server.conf +%if 0%{?with_adsl} +%files adsl +%defattr(-,root,root,0755) +%{_libdir}/%{name}/libnm-device-plugin-adsl.so +%else +%exclude %{_libdir}/%{name}/libnm-device-plugin-adsl.so +%endif + +%if 0%{?with_bluetooth} +%files bluetooth +%defattr(-,root,root,0755) +%{_libdir}/%{name}/libnm-device-plugin-bluetooth.so +%endif + +%if 0%{?with_team} +%files team +%defattr(-,root,root,0755) +%{_libdir}/%{name}/libnm-device-plugin-team.so +%endif + +%if 0%{?with_wifi} +%files wifi +%defattr(-,root,root,0755) +%{_libdir}/%{name}/libnm-device-plugin-wifi.so +%else +%exclude %{_libdir}/%{name}/libnm-device-plugin-wifi.so +%endif + +%if 0%{?with_wwan} +%files wwan +%defattr(-,root,root,0755) +%{_libdir}/%{name}/libnm-device-plugin-wwan.so +%{_libdir}/%{name}/libnm-wwan.so +%endif + +%if 0%{?with_wimax} +%files wimax +%defattr(-,root,root,0755) +%{_libdir}/%{name}/libnm-device-plugin-wimax.so +%endif + %files devel %defattr(-,root,root,0755) %doc ChangeLog docs/api/html/* @@ -445,10 +633,32 @@ fi %dir %{_datadir}/gtk-doc/html/libnm-util %{_datadir}/gtk-doc/html/libnm-util/* +%files libnm +%defattr(-,root,root,0755) +%{_libdir}/libnm.so.* +%{_libdir}/girepository-1.0/NM-1.0.typelib + +%files libnm-devel +%defattr(-,root,root,0755) +%dir %{_includedir}/libnm +%{_includedir}/libnm/*.h +%{_libdir}/pkgconfig/libnm.pc +%{_libdir}/libnm.so +%{_datadir}/gir-1.0/NM-1.0.gir +%dir %{_datadir}/gtk-doc/html/libnm +%{_datadir}/gtk-doc/html/libnm/* + %files config-server %defattr(-,root,root,0755) -%config %{_sysconfdir}/%{name}/conf.d/00-server.conf %doc README.nmcs +%dir %{_sysconfdir}/%{name} +%dir %{_sysconfdir}/%{name}/conf.d +%config(noreplace) %{_sysconfdir}/%{name}/conf.d/00-server.conf + +%files config-routing-rules +%defattr(-,root,root,0755) +%{_sysconfdir}/%{name}/dispatcher.d/10-ifcfg-rh-routes.sh +%{_sysconfdir}/%{name}/dispatcher.d/pre-up.d/10-ifcfg-rh-routes.sh %if 0%{?with_nmtui} %files tui @@ -456,17 +666,203 @@ fi %{_bindir}/nmtui-edit %{_bindir}/nmtui-connect %{_bindir}/nmtui-hostname +%{_mandir}/man1/nmtui* %endif %changelog -* Tue Dec 2 2014 Dan Williams - 1:0.9.9.1-29.git20140326 -- core: fix address lifetime padding and DHCP lease expiry (rh #1139326) (rh #1160160) +* Thu Jan 29 2015 Dan Winship - 1:1.0.0-14.git20150121.b4ea599c +- dispatcher: split routing rules script into a subpackage (rh #1160013) + +* Wed Jan 28 2015 Dan Williams - 1:1.0.0-13.git20150121.b4ea599c +- core: remove IPv6LL address when deactivating managed devices (rh #1184997) +- core: recognize external IP config earlier on startup +- core: fix bridge default metric + +* Wed Jan 28 2015 Dan Winship - 1:1.0.0-12.git20150121.b4ea599c +- dispatcher: fix policy-based-routing script to run on "down" as well (rh #1160013) + +* Tue Jan 27 2015 Jiří Klimeš - 1:1.0.0-11.git20150121.b4ea599c +- build: really install dispatcher script to support policy based routing (rh #1160013) + +* Thu Jan 22 2015 Dan Winship - 1:1.0.0-10.git20150121.b4ea599c +- team: fix bug in team device activation (rh #1184923) + +* Wed Jan 21 2015 Dan Williams - 1:1.0.0-9.git20150121.b4ea599c +- build: fix NetworkManager-libnm and old NetworkManager-glib conflict (rh #1066690) +- core: accept numeric bond options (rh #1171009) (rh #1133544) +- core/libnm: better validate setting properties (rh #1182567) +- core: add dispatcher script to support policy based routing (rh #1160013) + +* Thu Jan 15 2015 Jiří Klimeš - 1:1.0.0-8.git20150107.1ea95cd3 +- ifcfg-rh: read custom IP address for shared connections (rh #1174632) + +* Tue Jan 13 2015 Thomas Haller - 1:1.0.0-7.git20150107.1ea95cd3 +- platform: fix handling of routes with special metric (rh #1172780) +- ifcfg-rh: add reading and writing of route-metric property + +* Tue Jan 13 2015 Lubomir Rintel - 1:1.0.0-6.git20150107.1ea95cd3 +- platform: fix draining of the event queue with old libnl (rh #1180773) + +* Fri Jan 9 2015 Dan Williams - 1:1.0.0-5.git20150107.1ea95cd3 +- build: remove -bluetooth and -wwan Requires to prevent unwanted updates (rh #1066690) +- build: remove erroneous libnm/libnm-devel dependencies + +* Fri Jan 9 2015 Dan Winship - 1:1.0.0-4.git20150107.1ea95cd3 +- build: fix NetworkManager-bluetooth dep on NetworkManager-wwan + +* Fri Jan 9 2015 Dan Winship - 1:1.0.0-3.git20150107.1ea95cd3 +- ifcfg-rh: handle DEVTIMEOUT property (rh #1171917) + +* Thu Jan 08 2015 Dan Williams - 1:1.0.0-2.git20150107.1ea95cd3 +- core: re-enable hardware plugins on s390 (rh #1066690) + +* Wed Jan 07 2015 Dan Williams - 1:1.0.0-1.git20150107.1ea95cd3 +- Update to 1.0 release +- core: split device support into sub-packages (rh #1066690) +- core: don't touch externally created software interfaces until IFF_UP (rh #1030947) +- tui: fix handling of "Available to all users" checkbox (rh #1176042) + +* Fri Dec 12 2014 Dan Williams - 1:0.995.0.0-1 +- core: fix DHCP lease expiry/nak during lease acquisition +- core: don't step on external team interfaces when teamd appears + +* Thu Dec 11 2014 Dan Williams - 1:0.9.11.0-10.git20141211.9337a13a +- core: fix managed slave attachment + +* Thu Dec 11 2014 Dan Williams - 1:0.9.11.0-9.git20141211.da4a98bf +- core: recognize layer-2 connections (rh #1141266) +- core: don't tear down assumed connections that fail (rh #1141264) +- core: clean up IP operations when restarting them after re-authentication +- core: fix some VPN issues with secrets and routing +- core: fix regression parsing gateway from addresses (rh #1170199) +- core: don't release slaves on exit (rh #1169936) +- tui: fix deletion of slaves with master (rh #1131574) +- cli: fix regression deactivating multiple connections (rh #1168383) + +* Thu Dec 4 2014 Jiří Klimeš - 1:0.9.11.0-8.git20141125.f32075d2 +- core: don't bounce disable_ipv6 when assuming connections (rh #1170530) + +* Fri Nov 28 2014 Jiří Klimeš - 1:0.9.11.0-7.git20141125.f32075d2 +- device: fix crash on S390(x) when setting subchannels (rh #1168764) + +* Tue Nov 25 2014 Dan Williams - 1:0.9.11.0-6.git20141125.f32075d2 +- tui: fix missing IPv4/IPv6 method popup (rh #1167710) +- core: inherit parent managed state for VLAN devices (rh #1114681) + +* Tue Nov 18 2014 Dan Williams - 1:0.9.11.0-5.git20141118.646f335d +- cli: fix showing secrets when editing connections +- cli: ignore timestamp when comparing connections (rh #1122995) +- core: fix a few issues with the internal DHCP client (rh #1066700) + +* Fri Nov 14 2014 Dan Williams - 1:0.9.11.0-4.git20141114.669f74b8 +- core: wait for IPv6LL address before starting DHCPv6-only configurations +- core: fix race with kernel IPv6LL when deactiving connections that ignored IPv6 +- cli: fix waiting for activation success/failure +- core: silence warning about bad ifindex for non-netdev devices +- core: fix default route ordering issues +- core: don't change firewall zone for assumed devices (rh #1098281) +- libnm: fix translations in clients and non-UTF-8 encodings +- tui: fix unsetting the gateway (rh #1163896) +- cli/tui: only handle secrets for connection being activated + +* Mon Nov 10 2014 Dan Williams - 1:0.9.11.0-3.git20141110.gitb75dfc62 +- core: fix DHCP PID and platform route loop issues +- cli: fix timeout disconnecting device + +* Fri Nov 7 2014 Dan Williams - 1:0.9.11.0-2.git20141107.git14537c71 +- core: add fast, lightweight internal DHCP client (rh #1066700) +- rpm: specfile cleanups + +* Fri Nov 7 2014 Dan Williams - 1:0.9.11.0-1.git20141107.git289f7881 +- core: DHCP address lifetime expires before it can be updated (rh #1139326) +- core: apply static IPv6 configuration while waiting for an RA (rh #1101809) +- core: fix activation of IP configurations on unmanaged interfaces (rh #1067299) +- core: serialize dispatcher state changes (rh #1061212) +- core: increased dispatcher timeout and blocking events (rh #1048345) +- core: add support for "lacp_rate" bonding option (rh #1061702) +- core: better handle slave state changes done externally (rh #1066706) +- core: fix checking whether NM is running for root clients (rh #1096772) +- ifcfg-rh: ignore tailing spaces (rh #1100336) +- cli: fix warning setting DCB application priority (rh #1080510) +- tui: fix inverted 'Require IPvX addressing' checkbox (rh #1108839) +- tui: fix entry of some IP address formats (rh #1090422) +- tui: fix disabled button in IP configuration (rh #1131434) + +* Fri Oct 17 2014 Florian Müllner - 1:0.9.9.1-47.git20140326 +- remote-settings: Fix asynchronous initialization when using private bus + +* Fri Oct 10 2014 Lubomir Rintel - 1:0.9.9.1-46.git20140326 +- tui: Fix up bond primary option validation (rh #1142864) + +* Fri Oct 10 2014 Lubomir Rintel - 1:0.9.9.1-45.git20140326 +- bluetooth: don't consider bnep devices separate from the BT devices (rh #1147700) + +* Wed Oct 8 2014 Dan Winship - 1:0.9.9.1-44.git20140326 +- tui: fix master/slave deletion issues (rh #1131574) + +* Wed Oct 08 2014 Lubomir Rintel - 1:0.9.9.1-43.git20140326 +- bluetooth: fix connection timeouts (rh #1147700) + +* Fri Sep 26 2014 Jiří Klimeš - 1:0.9.9.1-42.git20140326 +- core: do not clear existing secrets on Update() without secrets (rh #1080628) + +* Tue Sep 23 2014 Jiří Klimeš - 1:0.9.9.1-41.git20140326 +- tui: require non-empty primary option for active-backup bonding mode (rh #1142864) + +* Mon Sep 22 2014 Jiří Klimeš - 1:0.9.9.1-40.git20140326 +- cli: create a connection if none exist in 'nmcli dev connect' (rh #1113941) + +* Mon Sep 22 2014 Lubomir Rintel - 1:0.9.9.1-39.git20140326 +- platform: Increase NL buffer size for systems with a lot of interfaces (rh #1141256) +- tui: Remove primary option if bond mode is not active-backup (rh #1142864) + +* Wed Sep 17 2014 Dan Winship - 1:0.9.9.1-38.git20140326 +- tui: fix password handling (rh #1133967) +- tui: save LEAP username correctly (rh #1133967) +- tui: fix a crash when dismissing password dialog (rh #1132612) + +* Wed Sep 17 2014 Lubomir Rintel - 1:0.9.9.1-37.git20140326 +- platform: fix setting preferred time for address (rh #1083283) + +* Tue Sep 16 2014 Dan Winship - 1:0.9.9.1-36.git20140326 +- tui: add support for editing DSL connections (rh #1105753) + +* Fri Sep 12 2014 Jiří Klimeš - 1:0.9.9.1-35.git20140326 +- core: don't generate a connection for unmanaged devices (rh #1136843) +- bluetooth: don't crash when switching off bluetooth (rh #1136387) +- dhcp: fix dhclient abnormal exit due to SIGPIPE (rh #1136836) + +* Thu Sep 11 2014 Dan Williams - 1:0.9.9.1-34.git20140326 +- core: allow IPv6 configuration of interfaces when inactive (rh #1083133) (rh #1098319) + +* Fri Sep 5 2014 Jiří Klimeš - 1:0.9.9.1-33.git20140326 +- cli: fix nmcli connection add (rh #1138303) + +* Thu Sep 04 2014 Dan Williams - 1:0.9.9.1-32.git20140326 +- core, ifcfg-rh, ibft: add support for iBFT VLAN connections (rh #990480) + +* Thu Aug 21 2014 Jiří Klimeš - 1:0.9.9.1-31.git20140326 +- core, cli: D-Bus Delete() call; 'nmcli device delete ' for SW devices (rh #1034150) +- cli: use readline library throughout nmcli when asking for input (rh #1007365) + +* Wed Aug 20 2014 Jiří Klimeš - 1:0.9.9.1-30.git20140326 +- ifcfg-rh: fix a crash on setting hostname with SELinux disabled (rh #1122826) +- cli: fix 'nmcli device wifi' crash with multiple wifi devices (rh #1131042) +- policy: don't use default (localhost) hostname as configured hostname (rh #1110436) +- ifcfg-rh: write GATEWAY instead of GATEWAY0 to be ifup-compatible (rh #1105770) +- libnm-util, cli: make explicit that we only allow VPN as secondaries (rh #1094296) + +* Wed Jul 30 2014 Dan Williams - 1:0.9.9.1-29.git20140326 +- build: fix issues with multilib upgrades (rh #1112367) -* Wed Oct 8 2014 Jiří Klimeš - 1:0.9.9.1-28.git20140326.2 -- ifcfg-rh: write GATEWAY instead of GATEWAY0 to be ifup-compatible (rh #1149996) +* Fri Jul 25 2014 Dan Winship - 1:0.9.9.1-28.git20140326 +- core: better PPPoE connection termination handling (rh #1061641) -* Wed Jul 30 2014 Dan Williams - 1:0.9.9.1-26.git20140326 -- build: fix issues with multilib upgrades (rh #1112367) +* Tue Jul 15 2014 Dan Williams - 1:0.9.9.1-27.git20140326 +- core: update translations (rh #1046891) + +* Mon Jul 7 2014 Thomas Haller - 1:0.9.9.1-26.git20140326 +- core: fix crash when calling DBUS function GetConnectionByUuid() (rh #1113508) * Tue Jul 1 2014 Jiří Klimeš - 1:0.9.9.1-25.git20140326 - core: fix MTU handling while merging/subtracting IP configs (rh #1093231)