diff --git a/.NetworkManager.metadata b/.NetworkManager.metadata index f46f1a8..ae2c31f 100644 --- a/.NetworkManager.metadata +++ b/.NetworkManager.metadata @@ -1 +1 @@ -2e8cb7d6ed32a91185c63d27af35c64e8aa25814 SOURCES/NetworkManager-1.0.0.git20150121.b4ea599c.tar.bz2 +2569a4ea7e1a2d0682b080c0bc883da3f2457cfa SOURCES/NetworkManager-1.0.6.tar.xz diff --git a/.gitignore b/.gitignore index 0550735..55eb1ca 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/NetworkManager-1.0.0.git20150121.b4ea599c.tar.bz2 +SOURCES/NetworkManager-1.0.6.tar.xz diff --git a/SOURCES/0002-config-bugfix-parse-commandline-options-into-correct.patch b/SOURCES/0002-config-bugfix-parse-commandline-options-into-correct.patch new file mode 100644 index 0000000..f3a3761 --- /dev/null +++ b/SOURCES/0002-config-bugfix-parse-commandline-options-into-correct.patch @@ -0,0 +1,36 @@ +From 8a22a98157f7f6773f3d1f295419569c6c880a47 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ulrich=20=C3=96lmann?= +Date: Thu, 27 Aug 2015 22:18:55 +0200 +Subject: [PATCH] config: bugfix: parse commandline options into correct object +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Config related commandline options should be parsed into a function argument but +were instead parsed into an object with local scope. As a result none of them +had any impact. + +Signed-off-by: Ulrich Ölmann + +Fixes: b4ad7434a87c165a77b615accbe1868a9df9221b + +https://mail.gnome.org/archives/networkmanager-list/2015-August/msg00033.html +--- + src/main.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/main.c b/src/main.c +index 495262e..a9bc479 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -246,7 +246,6 @@ do_early_setup (int *argc, char **argv[], NMConfigCmdLineOptions *config_cli) + {NULL} + }; + +- config_cli = nm_config_cmd_line_options_new (); + if (!nm_main_utils_early_setup ("NetworkManager", + argc, + argv, +-- +2.4.3 + diff --git a/SOURCES/0002-rh1184923-teamd.patch b/SOURCES/0002-rh1184923-teamd.patch deleted file mode 100644 index 338da73..0000000 --- a/SOURCES/0002-rh1184923-teamd.patch +++ /dev/null @@ -1,50 +0,0 @@ -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 deleted file mode 100644 index e390f8e..0000000 --- a/SOURCES/0003-rh1160013-rules.patch +++ /dev/null @@ -1,54 +0,0 @@ -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/0003-vpn-connection-fix-unsetting-the-gateway.patch b/SOURCES/0003-vpn-connection-fix-unsetting-the-gateway.patch new file mode 100644 index 0000000..61bac47 --- /dev/null +++ b/SOURCES/0003-vpn-connection-fix-unsetting-the-gateway.patch @@ -0,0 +1,31 @@ +From 15e4ee69dfeec8dd3670da262c11306de7488156 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Wed, 2 Sep 2015 19:19:18 +0200 +Subject: [PATCH 3/4] vpn-connection: fix unsetting the gateway + +Addresses the clash between the two commits which would cause the parent device +gateway to be overwritten with 0.0.0.0 upon route-based VPN activation: + +Fixes: 063677101ab7d43a9aa94c70eb1ca3a201269043 +Fixes: 1465c1d3260712fbe2fd0c78c7a1fcf0fb8ce753 +(cherry picked from commit da2ae8ce4e6cb03931454d7d6fa94866b03f6be2) +--- + src/vpn-manager/nm-vpn-connection.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c +index c34155e..f0e6149 100644 +--- a/src/vpn-manager/nm-vpn-connection.c ++++ b/src/vpn-manager/nm-vpn-connection.c +@@ -933,7 +933,7 @@ apply_parent_device_config (NMVpnConnection *connection) + * default route. */ + if (vpn4_parent_config) { + nm_ip4_config_merge (vpn4_parent_config, priv->ip4_config, NM_IP_CONFIG_MERGE_DEFAULT); +- nm_ip4_config_set_gateway (vpn4_parent_config, 0); ++ nm_ip4_config_unset_gateway (vpn4_parent_config); + } + if (vpn6_parent_config) { + nm_ip6_config_merge (vpn6_parent_config, priv->ip6_config, NM_IP_CONFIG_MERGE_DEFAULT); +-- +2.4.3 + diff --git a/SOURCES/0004-bridge-route-metric.patch b/SOURCES/0004-bridge-route-metric.patch deleted file mode 100644 index 650a321..0000000 --- a/SOURCES/0004-bridge-route-metric.patch +++ /dev/null @@ -1,52 +0,0 @@ -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/0004-device-don-t-reset-NM_UNMANAGED_DEFAULT-when-platfor.patch b/SOURCES/0004-device-don-t-reset-NM_UNMANAGED_DEFAULT-when-platfor.patch new file mode 100644 index 0000000..4ae6bee --- /dev/null +++ b/SOURCES/0004-device-don-t-reset-NM_UNMANAGED_DEFAULT-when-platfor.patch @@ -0,0 +1,34 @@ +From e10a8f1f375c9ff669a14674e14f9789b2f321b6 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Wed, 2 Sep 2015 19:39:00 +0200 +Subject: [PATCH 4/4] device: don't reset NM_UNMANAGED_DEFAULT when platform + doesn't override this + +This would cause the ip_vti0 generic device (that appears upon insertion of +ip_vti module during libreswan ipsec stack init) to go managed and brought UP. +Without addresses assigned the device would cause all the VPN traffic to +disappear in the oblivion. + +(cherry picked from commit 1c46ddf196b1e87782049e8f9ee3ada93e0dc85b) +--- + src/devices/nm-device.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index 5889582..b4e9252 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -1158,8 +1158,8 @@ nm_device_finish_init (NMDevice *self) + * Currently it can happen that NM deletes 127.0.0.1 address. */ + nm_device_set_initial_unmanaged_flag (self, NM_UNMANAGED_DEFAULT, TRUE); + } else if (priv->platform_link_initialized || (priv->is_nm_owned && nm_device_is_software (self))) { +- nm_platform_link_get_unmanaged (NM_PLATFORM_GET, priv->ifindex, &platform_unmanaged); +- nm_device_set_initial_unmanaged_flag (self, NM_UNMANAGED_DEFAULT, platform_unmanaged); ++ if (nm_platform_link_get_unmanaged (NM_PLATFORM_GET, priv->ifindex, &platform_unmanaged)) ++ nm_device_set_initial_unmanaged_flag (self, NM_UNMANAGED_DEFAULT, platform_unmanaged); + } else { + /* Hardware and externally-created software links stay unmanaged + * until they are fully initialized by the platform. NM created +-- +2.4.3 + diff --git a/SOURCES/0005-schedule-early-config.patch b/SOURCES/0005-schedule-early-config.patch deleted file mode 100644 index 8e0334a..0000000 --- a/SOURCES/0005-schedule-early-config.patch +++ /dev/null @@ -1,42 +0,0 @@ -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/0005-workaround-config-changed-signal.patch b/SOURCES/0005-workaround-config-changed-signal.patch new file mode 100644 index 0000000..d3bf954 --- /dev/null +++ b/SOURCES/0005-workaround-config-changed-signal.patch @@ -0,0 +1,282 @@ +From b74457ac82a360feb57c226f7f8a31a2d159ba17 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Mon, 7 Sep 2015 10:48:48 +0200 +Subject: [PATCH 1/3] config/test: add a test for nm_config_reload() with + different signals + +(cherry picked from commit e6c64af8be89374ed318ed1a395ead7cd00a6753) +(cherry picked from commit ce7687e49900a72dd2cdd9ee7595004e4f3cf4e6) +--- + src/tests/config/test-config.c | 82 ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 82 insertions(+) + +diff --git a/src/tests/config/test-config.c b/src/tests/config/test-config.c +index 8b8028e..a5975c1 100644 +--- a/src/tests/config/test-config.c ++++ b/src/tests/config/test-config.c +@@ -396,6 +396,86 @@ test_config_confdir_parse_error (void) + g_clear_error (&error); + } + ++/*****************************************************************************/ ++ ++static void ++_test_signal_config_changed_cb (NMConfig *config, ++ NMConfigData *config_data, ++ NMConfigChangeFlags changes, ++ NMConfigData *old_data, ++ gpointer user_data) ++{ ++ const NMConfigChangeFlags *expected = user_data; ++ ++ g_assert (changes); ++ g_assert_cmpint (changes, ==, *expected); ++ g_assert (NM_IS_CONFIG (config)); ++ g_assert (NM_IS_CONFIG_DATA (config_data)); ++ ++ g_assert (config_data == old_data); ++ g_assert (config_data == nm_config_get_data (config)); ++} ++ ++static void ++_test_signal_config_changed_cb2 (NMConfig *config, ++ NMConfigData *config_data, ++ NMConfigChangeFlags changes, ++ NMConfigData *old_data, ++ gpointer user_data) ++{ ++ const NMConfigChangeFlags *expected = user_data; ++ ++ g_assert (changes); ++ g_assert_cmpint (changes, ==, *expected); ++} ++ ++static void ++test_config_signal (void) ++{ ++ gs_unref_object NMConfig *config = NULL; ++ NMConfigChangeFlags expected; ++ gs_unref_object NMConfigData *config_data_orig = NULL; ++ ++ config = setup_config (NULL, SRCDIR "/NetworkManager.conf", "/no/such/dir", NULL); ++ ++ config_data_orig = g_object_ref (nm_config_get_data_orig (config)); ++ ++ g_signal_connect (G_OBJECT (config), ++ NM_CONFIG_SIGNAL_CONFIG_CHANGED, ++ G_CALLBACK (_test_signal_config_changed_cb), ++ &expected); ++ ++ expected = NM_CONFIG_CHANGE_SIGUSR1; ++ g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, "*config: signal SIGUSR1"); ++ nm_config_reload (config, SIGUSR1); ++ ++ expected = NM_CONFIG_CHANGE_SIGUSR2; ++ g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, "*config: signal SIGUSR2"); ++ nm_config_reload (config, SIGUSR2); ++ ++ expected = NM_CONFIG_CHANGE_SIGHUP; ++ g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, "*config: signal SIGHUP (no changes from disk)*"); ++ nm_config_reload (config, SIGHUP); ++ ++ ++ /* test with subscribing two signals... */ ++ g_signal_connect (G_OBJECT (config), ++ NM_CONFIG_SIGNAL_CONFIG_CHANGED, ++ G_CALLBACK (_test_signal_config_changed_cb2), ++ &expected); ++ expected = NM_CONFIG_CHANGE_SIGUSR2; ++ g_test_expect_message ("NetworkManager", G_LOG_LEVEL_MESSAGE, "*config: signal SIGUSR2"); ++ nm_config_reload (config, SIGUSR2); ++ g_signal_handlers_disconnect_by_func (config, _test_signal_config_changed_cb2, &expected); ++ ++ ++ g_signal_handlers_disconnect_by_func (config, _test_signal_config_changed_cb, &expected); ++ ++ g_assert (config_data_orig == nm_config_get_data (config)); ++} ++ ++/*****************************************************************************/ ++ + NMTST_DEFINE (); + + int +@@ -419,6 +499,8 @@ main (int argc, char **argv) + g_test_add_func ("/config/confdir", test_config_confdir); + g_test_add_func ("/config/confdir-parse-error", test_config_confdir_parse_error); + ++ g_test_add_func ("/config/signal", test_config_signal); ++ + /* This one has to come last, because it leaves its values in + * nm-config.c's global variables, and there's no way to reset + * those to NULL. +-- +2.4.3 + + +From ac6ed03af5be72b3fe0e6796804129e02043e18e Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Tue, 8 Sep 2015 21:39:40 +0200 +Subject: [PATCH 2/3] config: workaround invocation of "config-changed" signal + +There seems to be a bug in glib/ffi that hits on s390x/ppc64 architecture. +It causes @changes in nm-dns-manager.c:config_changed_cb() to be NONE, +although it is clearly set (see the related bug rh #1260577 for glib). + +Workaround this, by making the argument type a plain guint. + +Note that the ill behavior is caught by test_config_signal() in +"src/tests/config/test-config.c". + +Related: https://bugzilla.redhat.com/show_bug.cgi?id=1062301 +(cherry picked from commit e7d66f1df61ebdc7652ba34a4e1baddcc86b9e26) +(cherry picked from commit 9aecabe29f39350c5e31a61af4d49062108dfc89) +--- + src/nm-config.c | 12 +++++++++++- + src/tests/config/test-config.c | 5 ++++- + 2 files changed, 15 insertions(+), 2 deletions(-) + +diff --git a/src/nm-config.c b/src/nm-config.c +index 86b3d92..011e57f 100644 +--- a/src/nm-config.c ++++ b/src/nm-config.c +@@ -1214,7 +1214,17 @@ nm_config_class_init (NMConfigClass *config_class) + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMConfigClass, config_changed), + NULL, NULL, NULL, +- G_TYPE_NONE, 3, NM_TYPE_CONFIG_DATA, NM_TYPE_CONFIG_CHANGE_FLAGS, NM_TYPE_CONFIG_DATA); ++ G_TYPE_NONE, ++ 3, ++ NM_TYPE_CONFIG_DATA, ++ /* Use plain guint type for changes argument. This avoids ++ * glib/ffi bug https://bugzilla.redhat.com/show_bug.cgi?id=1260577 */ ++ /* NM_TYPE_CONFIG_CHANGE_FLAGS, */ ++ G_TYPE_UINT, ++ NM_TYPE_CONFIG_DATA); ++ ++ G_STATIC_ASSERT_EXPR (sizeof (guint) == sizeof (NMConfigChangeFlags)); ++ G_STATIC_ASSERT_EXPR (((gint64) ((NMConfigChangeFlags) -1)) > ((gint64) 0)); + } + + static void +diff --git a/src/tests/config/test-config.c b/src/tests/config/test-config.c +index a5975c1..b973e60 100644 +--- a/src/tests/config/test-config.c ++++ b/src/tests/config/test-config.c +@@ -458,7 +458,10 @@ test_config_signal (void) + nm_config_reload (config, SIGHUP); + + +- /* test with subscribing two signals... */ ++ /* test with subscribing two signals... ++ * ++ * This test exposes glib bug https://bugzilla.redhat.com/show_bug.cgi?id=1260577 ++ * for which we however have a workaround in 'nm-config.c' */ + g_signal_connect (G_OBJECT (config), + NM_CONFIG_SIGNAL_CONFIG_CHANGED, + G_CALLBACK (_test_signal_config_changed_cb2), +-- +2.4.3 + + +From 8bb4c36cdc6033a2216fbe3e8fbac23c9b3bc5f6 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Wed, 9 Sep 2015 12:22:16 +0200 +Subject: [PATCH 3/3] platform/test: add test for invoking platform signals + +There seems to be an issue with glib/ffi that causes failures +to pass enum-typed arguments to signals (related bug rh#1260577). + +Add a test for platform signals which, beside NM_CONFIG_SIGNAL_CONFIG_CHANGED, +is the only place where we use enum-typed arguments for signals. + +Strangely, this test doesn't cause the failure, so it's unclear why +the workaround was necessary for "config-changed" signal (commit +e7d66f1df61ebdc7652ba34a4e1baddcc86b9e26). + +(cherry picked from commit 52cd5ee6120b643aa143cbd439f81a0c02c8313e) +(cherry picked from commit d7970c58eb10e9d59c855d61017299a1a811ee2a) +--- + src/platform/tests/test-link.c | 47 ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 47 insertions(+) + +diff --git a/src/platform/tests/test-link.c b/src/platform/tests/test-link.c +index ce371b7..f9645d8 100644 +--- a/src/platform/tests/test-link.c ++++ b/src/platform/tests/test-link.c +@@ -118,6 +118,41 @@ software_add (NMLinkType link_type, const char *name) + } + + static void ++test_link_changed_signal_cb (NMPlatform *platform, ++ NMPObjectType obj_type, ++ int ifindex, ++ const NMPlatformIP4Route *route, ++ NMPlatformSignalChangeType change_type, ++ NMPlatformReason reason, ++ gboolean *p_test_link_changed_signal_arg) ++{ ++ /* test invocation of platform signals with multiple listeners ++ * connected to the signal. Platform signals have enum-typed ++ * arguments and there seem to be an issue with invoking such ++ * signals on s390x and ppc64 archs. ++ * https://bugzilla.redhat.com/show_bug.cgi?id=1260577 ++ * ++ * As the test shows, the failure is not reproducible for ++ * platform signals. ++ */ ++ g_assert (NM_IS_PLATFORM (platform)); ++ g_assert (platform == NM_PLATFORM_GET); ++ ++ g_assert (ifindex > 0); ++ g_assert (route); ++ ++ g_assert_cmpint (obj_type, ==, NMP_OBJECT_TYPE_LINK); ++ ++ g_assert_cmpint ((gint64) change_type, !=, (gint64) 0); ++ g_assert_cmpint (change_type, !=, NM_PLATFORM_SIGNAL_NONE); ++ ++ g_assert_cmpint ((gint64) reason, !=, (gint64) 0); ++ g_assert_cmpint (reason, !=, NM_PLATFORM_REASON_NONE); ++ ++ *p_test_link_changed_signal_arg = TRUE; ++} ++ ++static void + test_slave (int master, int type, SignalData *master_changed) + { + int ifindex; +@@ -125,6 +160,8 @@ test_slave (int master, int type, SignalData *master_changed) + SignalData *link_changed, *link_removed; + char *value; + NMLinkType link_type = nm_platform_link_get_type (NM_PLATFORM_GET, master); ++ gboolean test_link_changed_signal_arg1; ++ gboolean test_link_changed_signal_arg2; + + g_assert (NM_IN_SET (link_type, NM_LINK_TYPE_TEAM, NM_LINK_TYPE_BOND, NM_LINK_TYPE_BRIDGE)); + +@@ -158,11 +195,21 @@ test_slave (int master, int type, SignalData *master_changed) + else + g_assert (!nm_platform_link_is_up (NM_PLATFORM_GET, ifindex)); + ++ test_link_changed_signal_arg1 = FALSE; ++ test_link_changed_signal_arg2 = FALSE; ++ g_signal_connect (NM_PLATFORM_GET, NM_PLATFORM_SIGNAL_LINK_CHANGED, G_CALLBACK (test_link_changed_signal_cb), &test_link_changed_signal_arg1); ++ g_signal_connect (NM_PLATFORM_GET, NM_PLATFORM_SIGNAL_LINK_CHANGED, G_CALLBACK (test_link_changed_signal_cb), &test_link_changed_signal_arg2); ++ + /* Set master up */ + g_assert (nm_platform_link_set_up (NM_PLATFORM_GET, master, NULL)); + g_assert (nm_platform_link_is_up (NM_PLATFORM_GET, master)); + accept_signals (master_changed, 1, 2); + ++ g_signal_handlers_disconnect_by_func (NM_PLATFORM_GET, G_CALLBACK (test_link_changed_signal_cb), &test_link_changed_signal_arg1); ++ g_signal_handlers_disconnect_by_func (NM_PLATFORM_GET, G_CALLBACK (test_link_changed_signal_cb), &test_link_changed_signal_arg2); ++ g_assert (test_link_changed_signal_arg1); ++ g_assert (test_link_changed_signal_arg2); ++ + /* Master with a disconnected slave is disconnected + * + * For some reason, bonding and teaming slaves are automatically set up. We +-- +2.4.3 + diff --git a/SOURCES/0006-fix-ignore-auto-dns-for-ipv6-rh1261428.patch b/SOURCES/0006-fix-ignore-auto-dns-for-ipv6-rh1261428.patch new file mode 100644 index 0000000..23668e6 --- /dev/null +++ b/SOURCES/0006-fix-ignore-auto-dns-for-ipv6-rh1261428.patch @@ -0,0 +1,34 @@ +From 6aa521cd2a8d77aee3caafe3413090c683f13cb1 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Wed, 9 Sep 2015 12:59:01 +0200 +Subject: [PATCH 1/1] core: fix handling ignore-auto-dns for IPv6 nameservers + +https://bugzilla.redhat.com/show_bug.cgi?id=1261428 + +Fixes: f7a8962dd47099425438ee484e02f40e18b6ee79 +(cherry picked from commit e0fe47b74e92e9614717a3d918eed3fc0bc6b2ea) +(cherry picked from commit 8de6ee4ebad93cd1f552c666183a4fac76274aa5) +--- + src/nm-ip6-config.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c +index 9647268..ef25623 100644 +--- a/src/nm-ip6-config.c ++++ b/src/nm-ip6-config.c +@@ -635,8 +635,10 @@ nm_ip6_config_merge (NMIP6Config *dst, const NMIP6Config *src, NMIPConfigMergeFl + nm_ip6_config_add_address (dst, nm_ip6_config_get_address (src, i)); + + /* nameservers */ +- for (i = 0; i < nm_ip6_config_get_num_nameservers (src); i++) +- nm_ip6_config_add_nameserver (dst, nm_ip6_config_get_nameserver (src, i)); ++ if (!NM_FLAGS_HAS (merge_flags, NM_IP_CONFIG_MERGE_NO_DNS)) { ++ for (i = 0; i < nm_ip6_config_get_num_nameservers (src); i++) ++ nm_ip6_config_add_nameserver (dst, nm_ip6_config_get_nameserver (src, i)); ++ } + + /* default gateway */ + if (nm_ip6_config_get_gateway (src)) +-- +2.4.3 + diff --git a/SOURCES/0006-rh1184997-ip6ll-flush.patch b/SOURCES/0006-rh1184997-ip6ll-flush.patch deleted file mode 100644 index c9ed97f..0000000 --- a/SOURCES/0006-rh1184997-ip6ll-flush.patch +++ /dev/null @@ -1,83 +0,0 @@ -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 deleted file mode 100644 index 5b47da7..0000000 --- a/SOURCES/0007-rh1160013-rules-subpackage.patch +++ /dev/null @@ -1,13 +0,0 @@ -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/0007-rh1260243-iface-helper-enabled-slaac.patch b/SOURCES/0007-rh1260243-iface-helper-enabled-slaac.patch new file mode 100644 index 0000000..af3e770 --- /dev/null +++ b/SOURCES/0007-rh1260243-iface-helper-enabled-slaac.patch @@ -0,0 +1,90 @@ +From 60b7ecc242c6b6e485385c045b848702b0e9e0fb Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Fri, 11 Sep 2015 17:07:23 +0200 +Subject: [PATCH 1/1] iface-helper: enabled dhcp4/slaac according to IP method + +If at the moment when spawning nm-iface-helper dhcp4/slaac +did not yet complete, we would not enable it. + +That is wrong. If the connection indicates to use dhcp4/slaac, +it should be used by nm-iface-helper without considering the +current state on the device. + +https://bugzilla.redhat.com/show_bug.cgi?id=1260243 +(cherry picked from commit b0815813fa450c40e3a34ce5d6bb9c99aa26e605) +(cherry picked from commit 1ec0b4e7e889b7cedfd1883a48561c35b19cafdf) +--- + src/devices/nm-device.c | 41 ++++++++++++++++++----------------------- + 1 file changed, 18 insertions(+), 23 deletions(-) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index b4e9252..d75bf5e 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -8206,15 +8206,9 @@ nm_device_spawn_iface_helper (NMDevice *self) + dhcp4_address = find_dhcp4_address (self); + + method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP4_CONFIG); +- if ( priv->ip4_config +- && priv->ip4_state == IP_DONE +- && g_strcmp0 (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0 +- && priv->dhcp4_client +- && dhcp4_address) { ++ if (g_strcmp0 (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0) { + NMSettingIPConfig *s_ip4; +- GBytes *client_id; + char *hex_client_id; +- const char *hostname; + + s_ip4 = nm_connection_get_setting_ip4_config (connection); + g_assert (s_ip4); +@@ -8227,29 +8221,30 @@ nm_device_spawn_iface_helper (NMDevice *self) + if (nm_setting_ip_config_get_may_fail (s_ip4) == FALSE) + g_ptr_array_add (argv, g_strdup ("--dhcp4-required")); + +- client_id = nm_dhcp_client_get_client_id (priv->dhcp4_client); +- if (client_id) { +- g_ptr_array_add (argv, g_strdup ("--dhcp4-clientid")); +- hex_client_id = bin2hexstr (g_bytes_get_data (client_id, NULL), +- g_bytes_get_size (client_id)); +- g_ptr_array_add (argv, hex_client_id); +- } ++ if (priv->dhcp4_client) { ++ const char *hostname; ++ GBytes *client_id; + +- hostname = nm_dhcp_client_get_hostname (priv->dhcp4_client); +- if (hostname) { +- g_ptr_array_add (argv, g_strdup ("--dhcp4-hostname")); +- g_ptr_array_add (argv, g_strdup (hostname)); ++ client_id = nm_dhcp_client_get_client_id (priv->dhcp4_client); ++ if (client_id) { ++ g_ptr_array_add (argv, g_strdup ("--dhcp4-clientid")); ++ hex_client_id = bin2hexstr (g_bytes_get_data (client_id, NULL), ++ g_bytes_get_size (client_id)); ++ g_ptr_array_add (argv, hex_client_id); ++ } ++ ++ hostname = nm_dhcp_client_get_hostname (priv->dhcp4_client); ++ if (hostname) { ++ g_ptr_array_add (argv, g_strdup ("--dhcp4-hostname")); ++ g_ptr_array_add (argv, g_strdup (hostname)); ++ } + } + + configured = TRUE; + } + + method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP6_CONFIG); +- if ( priv->ip6_config +- && priv->ip6_state == IP_DONE +- && g_strcmp0 (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0 +- && priv->rdisc +- && priv->ac_ip6_config) { ++ if (g_strcmp0 (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0) { + NMSettingIPConfig *s_ip6; + char *hex_iid; + NMUtilsIPv6IfaceId iid = NM_UTILS_IPV6_IFACE_ID_INIT; +-- +2.4.3 + diff --git a/SOURCES/0008-match-cloned-mac-with-empty-one-rh1256430.patch b/SOURCES/0008-match-cloned-mac-with-empty-one-rh1256430.patch new file mode 100644 index 0000000..8674f7b --- /dev/null +++ b/SOURCES/0008-match-cloned-mac-with-empty-one-rh1256430.patch @@ -0,0 +1,145 @@ +From d40ace0df0a6796cdc444a1fc89ba2835734845d Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 19 Feb 2015 17:53:43 +0100 +Subject: [PATCH] utils: match a cloned mac address with a connection that does + not specify it + +We do the same for the original MAC address. + +A device enslaved to a bond it inherits the bond's MAC address. When +NetworkManager tries to assume a connection the generated cloned-mac property +causes a mismatch with the connection that originally brought up the device, +causing the generated connection to be used instead: + + NetworkManager[14190]: [1424355817.112154] [NetworkManagerUtils.c:1641] + nm_utils_match_connection(): Connection 'eth2' differs from candidate + 'bond-slave-eth2' in 802-3-ethernet.cloned-mac-address + +https://bugzilla.gnome.org/show_bug.cgi?id=744812 +https://bugzilla.redhat.com/show_bug.cgi?id=1256430 +(cherry picked from commit cd2cef9cab62db042f646bf0fcdc318106fc627f) +--- + src/NetworkManagerUtils.c | 36 ++++++++++++++++++++++++++++++++++++ + src/tests/test-general.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 81 insertions(+) + +diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c +index 63741dc..584b10c 100644 +--- a/src/NetworkManagerUtils.c ++++ b/src/NetworkManagerUtils.c +@@ -2033,6 +2033,39 @@ check_connection_mac_address (NMConnection *orig, + return FALSE; + } + ++static gboolean ++check_connection_cloned_mac_address (NMConnection *orig, ++ NMConnection *candidate, ++ GHashTable *settings) ++{ ++ GHashTable *props; ++ const char *orig_mac = NULL, *cand_mac = NULL; ++ NMSettingWired *s_wired_orig, *s_wired_cand; ++ ++ props = check_property_in_hash (settings, ++ NM_SETTING_WIRED_SETTING_NAME, ++ NM_SETTING_WIRED_CLONED_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); ++ if (s_wired_orig) ++ orig_mac = nm_setting_wired_get_cloned_mac_address (s_wired_orig); ++ ++ s_wired_cand = nm_connection_get_setting_wired (candidate); ++ if (s_wired_cand) ++ cand_mac = nm_setting_wired_get_cloned_mac_address (s_wired_cand); ++ ++ if (!orig_mac || !cand_mac) { ++ remove_from_hash (settings, props, ++ NM_SETTING_WIRED_SETTING_NAME, ++ NM_SETTING_WIRED_CLONED_MAC_ADDRESS); ++ return TRUE; ++ } ++ return FALSE; ++} ++ + static NMConnection * + check_possible_match (NMConnection *orig, + NMConnection *candidate, +@@ -2053,6 +2086,9 @@ check_possible_match (NMConnection *orig, + if (!check_connection_mac_address (orig, candidate, settings)) + return NULL; + ++ if (!check_connection_cloned_mac_address (orig, candidate, settings)) ++ return NULL; ++ + if (g_hash_table_size (settings) == 0) + return candidate; + else +diff --git a/src/tests/test-general.c b/src/tests/test-general.c +index de65d50..eda7a1f 100644 +--- a/src/tests/test-general.c ++++ b/src/tests/test-general.c +@@ -440,6 +440,50 @@ test_connection_match_wired (void) + } + + static void ++test_connection_match_cloned_mac (void) ++{ ++ NMConnection *orig, *exact, *fuzzy, *matched; ++ GSList *connections = NULL; ++ NMSettingWired *s_wired; ++ ++ orig = _match_connection_new (); ++ ++ fuzzy = nm_simple_connection_new_clone (orig); ++ connections = g_slist_append (connections, fuzzy); ++ s_wired = nm_connection_get_setting_wired (orig); ++ g_assert (s_wired); ++ g_object_set (G_OBJECT (s_wired), ++ NM_SETTING_WIRED_CLONED_MAC_ADDRESS, "52:54:00:ab:db:23", ++ NULL); ++ ++ matched = nm_utils_match_connection (connections, orig, TRUE, NULL, NULL); ++ g_assert (matched == fuzzy); ++ ++ exact = nm_simple_connection_new_clone (orig); ++ connections = g_slist_append (connections, exact); ++ s_wired = nm_connection_get_setting_wired (exact); ++ g_assert (s_wired); ++ g_object_set (G_OBJECT (s_wired), ++ NM_SETTING_WIRED_CLONED_MAC_ADDRESS, "52:54:00:ab:db:23", ++ NULL); ++ ++ matched = nm_utils_match_connection (connections, orig, TRUE, NULL, NULL); ++ g_assert (matched == exact); ++ ++ g_object_set (G_OBJECT (s_wired), ++ NM_SETTING_WIRED_CLONED_MAC_ADDRESS, "52:54:00:ab:db:24", ++ NULL); ++ ++ matched = nm_utils_match_connection (connections, orig, TRUE, NULL, NULL); ++ g_assert (matched == fuzzy); ++ ++ g_slist_free (connections); ++ g_object_unref (orig); ++ g_object_unref (fuzzy); ++ g_object_unref (exact); ++} ++ ++static void + test_connection_no_match_ip4_addr (void) + { + NMConnection *orig, *copy, *matched; +@@ -747,6 +791,7 @@ main (int argc, char **argv) + 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/cloned_mac", test_connection_match_cloned_mac); + g_test_add_func ("/general/connection-match/no-match-ip4-addr", test_connection_no_match_ip4_addr); + + g_test_add_func ("/general/connection-sort/autoconnect-priority", test_connection_sort_autoconnect_priority); +-- +2.4.3 + diff --git a/SOURCES/0008-rh1224366-fix-valid-path-assertion.patch b/SOURCES/0008-rh1224366-fix-valid-path-assertion.patch deleted file mode 100644 index 183685d..0000000 --- a/SOURCES/0008-rh1224366-fix-valid-path-assertion.patch +++ /dev/null @@ -1,347 +0,0 @@ -From 5eb7b04a6fb0affd7444255a7d668a44338f795d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Wed, 27 May 2015 11:20:31 +0200 -Subject: [PATCH 1/4] device: trivial: fix a copy/paste error in comment -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Jiří Klimeš ---- - src/devices/nm-device.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c -index a352783..c455e45 100644 ---- a/src/devices/nm-device.c -+++ b/src/devices/nm-device.c -@@ -546,7 +546,7 @@ nm_device_get_ip_ifindex (NMDevice *self) - g_return_val_if_fail (self != NULL, 0); - - priv = NM_DEVICE_GET_PRIVATE (self); -- /* If it's not set, default to iface */ -+ /* If it's not set, default to ifindex */ - return priv->ip_iface ? priv->ip_ifindex : priv->ifindex; - } - --- -2.1.0 - - -From a32d216fcbebe9652cb5e5b7627ffdd9d50d1c51 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= -Date: Fri, 12 Jun 2015 21:46:46 +0200 -Subject: [PATCH 2/4] utils: fix error logging in ASSERT_VALID_PATH_COMPONENT() -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Jiří Klimeš ---- - src/NetworkManagerUtils.c | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c -index 6747b65..231031a 100644 ---- a/src/NetworkManagerUtils.c -+++ b/src/NetworkManagerUtils.c -@@ -2254,10 +2254,7 @@ ASSERT_VALID_PATH_COMPONENT (const char *name) - - return name; - fail: -- if (name) -- nm_log_err (LOGD_CORE, "Failed asserting path component: NULL"); -- else -- nm_log_err (LOGD_CORE, "Failed asserting path component: \"%s\"", name); -+ nm_log_err (LOGD_CORE, "Failed asserting path component: \"%s\"", name ? name : "(null)"); - g_error ("FATAL: Failed asserting path component: %s", name ? name : "(null)"); - g_assert_not_reached (); - } --- -2.1.0 - - -From bd987c7895f1c7edcbc55c9c3ddf13007926a58e Mon Sep 17 00:00:00 2001 -From: Thomas Haller -Date: Tue, 28 Apr 2015 17:59:07 +0200 -Subject: [PATCH 3/4] utils: add nm_clear_g_source() helper -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Utility function to simplify the following common code: - - if (priv->timeout_id) { - g_source_remove (priv->timeout_id); - priv->timeout_id = 0; - } - -to - - nm_clear_g_source (&priv->timeout_id); - -Signed-off-by: Jiří Klimeš ---- - include/nm-utils-internal.h | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) - -diff --git a/include/nm-utils-internal.h b/include/nm-utils-internal.h -index c002b6c..49fdb0c 100644 ---- a/include/nm-utils-internal.h -+++ b/include/nm-utils-internal.h -@@ -100,4 +100,19 @@ - _found; \ - }) - -+/*****************************************************************************/ -+ -+static inline gboolean -+nm_clear_g_source (guint *id) -+{ -+ if (id && *id) { -+ g_source_remove (*id); -+ *id = 0; -+ return TRUE; -+ } -+ return FALSE; -+} -+ -+/*****************************************************************************/ -+ - #endif --- -2.1.0 - - -From b663b43890efd1c0965cde7eaf1d136ff754db23 Mon Sep 17 00:00:00 2001 -From: Thomas Haller -Date: Tue, 7 Jul 2015 17:33:38 +0200 -Subject: [PATCH 4/4] device: delay handling of link-changed platform event -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When inside a state-change, we set for example the device up. -This triggers a link-changed event, which then causes further -state-changes of the devices. -A state-change in process of a device is not reentrant, so we must -delay the handling of the link-changed event. - -(cherry picked from commit 04caae735fabe00e19a05d49e065514114b59d40) -Signed-off-by: Jiří Klimeš ---- - src/devices/nm-device.c | 94 ++++++++++++++++++++++++++++++++++--------------- - 1 file changed, 65 insertions(+), 29 deletions(-) - -diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c -index c455e45..834360a 100644 ---- a/src/devices/nm-device.c -+++ b/src/devices/nm-device.c -@@ -180,6 +180,9 @@ typedef struct { - gboolean in_state_changed; - gboolean initialized; - -+ guint device_link_changed_id; -+ guint device_ip_link_changed_id; -+ - NMDeviceState state; - NMDeviceStateReason state_reason; - QueuedState queued_state; -@@ -1206,31 +1209,39 @@ device_set_master (NMDevice *self, int ifindex) - } - } - --static void --device_link_changed (NMDevice *self, NMPlatformLink *info) -+static gboolean -+device_link_changed (NMDevice *self) - { - NMDeviceClass *klass = NM_DEVICE_GET_CLASS (self); - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - gboolean ip_ifname_changed = FALSE; -+ NMPlatformLink info; -+ int ifindex; - -- if (info->udi && g_strcmp0 (info->udi, priv->udi)) { -+ priv->device_link_changed_id = 0; -+ -+ ifindex = nm_device_get_ifindex (self); -+ if (!nm_platform_link_get (ifindex, &info)) -+ return G_SOURCE_REMOVE; -+ -+ if (info.udi && g_strcmp0 (info.udi, priv->udi)) { - /* Update UDI to what udev gives us */ - g_free (priv->udi); -- priv->udi = g_strdup (info->udi); -+ priv->udi = g_strdup (info.udi); - g_object_notify (G_OBJECT (self), NM_DEVICE_UDI); - } - - /* Update MTU if it has changed. */ -- if (priv->mtu != info->mtu) { -- priv->mtu = info->mtu; -+ if (priv->mtu != info.mtu) { -+ priv->mtu = info.mtu; - g_object_notify (G_OBJECT (self), NM_DEVICE_MTU); - } - -- if (info->name[0] && strcmp (priv->iface, info->name) != 0) { -+ if (info.name[0] && strcmp (priv->iface, info.name) != 0) { - _LOGI (LOGD_DEVICE, "interface index %d renamed iface from '%s' to '%s'", -- priv->ifindex, priv->iface, info->name); -+ priv->ifindex, priv->iface, info.name); - g_free (priv->iface); -- priv->iface = g_strdup (info->name); -+ priv->iface = g_strdup (info.name); - - /* If the device has no explicit ip_iface, then changing iface changes ip_iface too. */ - ip_ifname_changed = !priv->ip_iface; -@@ -1249,30 +1260,30 @@ device_link_changed (NMDevice *self, NMPlatformLink *info) - } - - /* Update slave status for external changes */ -- if (priv->enslaved && info->master != nm_device_get_ifindex (priv->master)) -+ if (priv->enslaved && info.master != nm_device_get_ifindex (priv->master)) - nm_device_release_one_slave (priv->master, self, FALSE, NM_DEVICE_STATE_REASON_NONE); -- if (info->master && !priv->enslaved) { -- device_set_master (self, info->master); -+ if (info.master && !priv->enslaved) { -+ device_set_master (self, info.master); - if (priv->master) - nm_device_enslave_slave (priv->master, self, NULL); - } - - if (klass->link_changed) -- klass->link_changed (self, info); -+ klass->link_changed (self, &info); - - /* Update DHCP, etc, if needed */ - if (ip_ifname_changed) - update_for_ip_ifname_change (self); - -- if (priv->up != info->up) { -- priv->up = info->up; -+ if (priv->up != info.up) { -+ priv->up = info.up; - - /* Manage externally-created software interfaces only when they are IFF_UP */ - g_assert (priv->ifindex > 0); - if (is_software_external (self)) { - gboolean external_down = nm_device_get_unmanaged_flag (self, NM_UNMANAGED_EXTERNAL_DOWN); - -- if (external_down && info->up) { -+ if (external_down && info.up) { - if (nm_device_get_state (self) < NM_DEVICE_STATE_DISCONNECTED) { - /* Ensure the assume check is queued before any queued state changes - * from the transition to UNAVAILABLE. -@@ -1295,7 +1306,7 @@ device_link_changed (NMDevice *self, NMPlatformLink *info) - */ - priv->unmanaged_flags &= ~NM_UNMANAGED_EXTERNAL_DOWN; - } -- } else if (!external_down && !info->up && nm_device_get_state (self) <= NM_DEVICE_STATE_DISCONNECTED) { -+ } else if (!external_down && !info.up && nm_device_get_state (self) <= NM_DEVICE_STATE_DISCONNECTED) { - /* If the device is already disconnected and is set !IFF_UP, - * unmanage it. - */ -@@ -1306,23 +1317,34 @@ device_link_changed (NMDevice *self, NMPlatformLink *info) - } - } - } -+ -+ return G_SOURCE_REMOVE; - } - --static void --device_ip_link_changed (NMDevice *self, NMPlatformLink *info) -+static gboolean -+device_ip_link_changed (NMDevice *self) - { - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); -+ NMPlatformLink info; -+ int ip_ifindex; -+ -+ priv->device_ip_link_changed_id = 0; - -- if (info->name[0] && g_strcmp0 (priv->ip_iface, info->name)) { -+ ip_ifindex = nm_device_get_ip_ifindex (self); -+ if (!nm_platform_link_get (ip_ifindex, &info)) -+ return G_SOURCE_REMOVE; -+ -+ if (info.name[0] && g_strcmp0 (priv->ip_iface, info.name)) { - _LOGI (LOGD_DEVICE, "interface index %d renamed ip_iface (%d) from '%s' to '%s'", - priv->ifindex, nm_device_get_ip_ifindex (self), -- priv->ip_iface, info->name); -+ priv->ip_iface, info.name); - g_free (priv->ip_iface); -- priv->ip_iface = g_strdup (info->name); -+ priv->ip_iface = g_strdup (info.name); - - g_object_notify (G_OBJECT (self), NM_DEVICE_IP_IFACE); - update_for_ip_ifname_change (self); - } -+ return G_SOURCE_REMOVE; - } - - static void -@@ -1333,19 +1355,30 @@ link_changed_cb (NMPlatform *platform, - NMPlatformReason reason, - NMDevice *self) - { -+ NMDevicePrivate *priv; -+ - if (change_type != NM_PLATFORM_SIGNAL_CHANGED) - return; - -+ priv = NM_DEVICE_GET_PRIVATE (self); -+ - /* We don't filter by 'reason' because we are interested in *all* link - * changes. For example a call to nm_platform_link_set_up() may result - * in an internal carrier change (i.e. we ask the kernel to set IFF_UP - * and it results in also setting IFF_LOWER_UP. - */ - -- if (ifindex == nm_device_get_ifindex (self)) -- device_link_changed (self, info); -- else if (ifindex == nm_device_get_ip_ifindex (self)) -- device_ip_link_changed (self, info); -+ if (ifindex == nm_device_get_ifindex (self)) { -+ if (!priv->device_link_changed_id) { -+ priv->device_link_changed_id = g_idle_add ((GSourceFunc) device_link_changed, self); -+ _LOGD (LOGD_DEVICE, "queued link change for ifindex %d", ifindex); -+ } -+ } else if (ifindex == nm_device_get_ip_ifindex (self)) { -+ if (!priv->device_ip_link_changed_id) { -+ priv->device_ip_link_changed_id = g_idle_add ((GSourceFunc) device_ip_link_changed, self); -+ _LOGD (LOGD_DEVICE, "queued link change for ip-ifindex %d", ifindex); -+ } -+ } - } - - static void -@@ -6677,10 +6710,10 @@ device_ip_changed (NMPlatform *platform, - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - - if (nm_device_get_ip_ifindex (self) == ifindex) { -- if (!priv->queued_ip_config_id) -+ if (!priv->queued_ip_config_id) { - priv->queued_ip_config_id = g_idle_add (queued_ip_config_change, self); -- -- _LOGD (LOGD_DEVICE, "queued IP config change"); -+ _LOGD (LOGD_DEVICE, "queued IP config change"); -+ } - } - } - -@@ -8257,6 +8290,9 @@ dispose (GObject *object) - g_signal_handlers_disconnect_by_func (platform, G_CALLBACK (device_ip_changed), self); - g_signal_handlers_disconnect_by_func (platform, G_CALLBACK (link_changed_cb), self); - -+ nm_clear_g_source (&priv->device_link_changed_id); -+ nm_clear_g_source (&priv->device_ip_link_changed_id); -+ - G_OBJECT_CLASS (nm_device_parent_class)->dispose (object); - } - --- -2.1.0 - diff --git a/SOURCES/0009-rh1128581-respawn-ping-on-error.patch b/SOURCES/0009-rh1128581-respawn-ping-on-error.patch deleted file mode 100644 index 264f544..0000000 --- a/SOURCES/0009-rh1128581-respawn-ping-on-error.patch +++ /dev/null @@ -1,239 +0,0 @@ -From 8b53b4ee75f17341901b8f95f27a99fdbb771dba Mon Sep 17 00:00:00 2001 -From: Beniamino Galvani -Date: Tue, 14 Jul 2015 18:59:10 +0200 -Subject: [PATCH] device: restart ping process when it exits with an error - -When ping is launched to check the connectivity to the gateway it may -return earlier than the given timeout in case of error. When this -happens we need to respawn it until the timeout is reached. - -While at it, increase maximum timeout value to 600 seconds. - -https://bugzilla.redhat.com/show_bug.cgi?id=1128581 - -(cherry picked from commit e86f8354a7aa5f8ba95b319f54f70e3e8aa9dbb7) ---- - libnm-core/nm-setting-connection.c | 2 +- - src/devices/nm-device.c | 126 +++++++++++++++++++++++++------------ - 2 files changed, 86 insertions(+), 42 deletions(-) - -diff --git a/libnm-core/nm-setting-connection.c b/libnm-core/nm-setting-connection.c -index 01f5d42..541ef87 100644 ---- a/libnm-core/nm-setting-connection.c -+++ b/libnm-core/nm-setting-connection.c -@@ -1562,7 +1562,7 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class) - g_object_class_install_property - (object_class, PROP_GATEWAY_PING_TIMEOUT, - g_param_spec_uint (NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT, "", "", -- 0, 30, 0, -+ 0, 600, 0, - G_PARAM_READWRITE | - G_PARAM_CONSTRUCT | - G_PARAM_STATIC_STRINGS)); -diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c -index 1295dc2..f753843 100644 ---- a/src/devices/nm-device.c -+++ b/src/devices/nm-device.c -@@ -76,6 +76,7 @@ _LOG_DECLARE_SELF (NMDevice); - - static void impl_device_disconnect (NMDevice *self, DBusGMethodInvocation *context); - static void impl_device_delete (NMDevice *self, DBusGMethodInvocation *context); -+static void ip_check_ping_watch_cb (GPid pid, gint status, gpointer user_data); - - #include "nm-device-glue.h" - -@@ -164,6 +165,9 @@ typedef struct { - guint timeout; - guint watch; - GPid pid; -+ const char *binary; -+ const char *address; -+ guint deadline; - } PingInfo; - - typedef struct { -@@ -6108,19 +6112,67 @@ ip_check_gw_ping_cleanup (NMDevice *self) - { - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - -- if (priv->gw_ping.watch) { -- g_source_remove (priv->gw_ping.watch); -- priv->gw_ping.watch = 0; -- } -- if (priv->gw_ping.timeout) { -- g_source_remove (priv->gw_ping.timeout); -- priv->gw_ping.timeout = 0; -- } -+ nm_clear_g_source (&priv->gw_ping.watch); -+ nm_clear_g_source (&priv->gw_ping.timeout); - - if (priv->gw_ping.pid) { - nm_utils_kill_child_async (priv->gw_ping.pid, SIGTERM, priv->gw_ping.log_domain, "ping", 1000, NULL, NULL); - priv->gw_ping.pid = 0; - } -+ -+ g_clear_pointer (&priv->gw_ping.binary, g_free); -+ g_clear_pointer (&priv->gw_ping.address, g_free); -+} -+ -+static gboolean -+spawn_ping (NMDevice *self) -+{ -+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); -+ gs_free char *str_timeout = NULL; -+ gs_free char *tmp_str = NULL; -+ const char *args[] = { priv->gw_ping.binary, "-I", nm_device_get_ip_iface (self), -+ "-c", "1", "-w", NULL, priv->gw_ping.address, NULL }; -+ gs_free_error GError *error = NULL; -+ gboolean ret; -+ -+ args[6] = str_timeout = g_strdup_printf ("%u", priv->gw_ping.deadline); -+ tmp_str = g_strjoinv (" ", (gchar **) args); -+ _LOGD (priv->gw_ping.log_domain, "ping: running '%s'", tmp_str); -+ -+ ret = g_spawn_async ("/", -+ (gchar **) args, -+ NULL, -+ G_SPAWN_DO_NOT_REAP_CHILD, -+ NULL, -+ NULL, -+ &priv->gw_ping.pid, -+ &error); -+ -+ if (!ret) { -+ _LOGW (priv->gw_ping.log_domain, "ping: could not spawn %s: %s", -+ priv->gw_ping.binary, error->message); -+ } -+ -+ return ret; -+} -+ -+static gboolean -+respawn_ping_cb (gpointer user_data) -+{ -+ NMDevice *self = NM_DEVICE (user_data); -+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); -+ -+ priv->gw_ping.watch = 0; -+ -+ if (spawn_ping (self)) { -+ priv->gw_ping.watch = g_child_watch_add (priv->gw_ping.pid, -+ ip_check_ping_watch_cb, self); -+ } else { -+ ip_check_gw_ping_cleanup (self); -+ ip_check_pre_up (self); -+ } -+ -+ return FALSE; - } - - static void -@@ -6129,6 +6181,7 @@ ip_check_ping_watch_cb (GPid pid, gint status, gpointer user_data) - NMDevice *self = NM_DEVICE (user_data); - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - guint log_domain = priv->gw_ping.log_domain; -+ gboolean success = FALSE; - - if (!priv->gw_ping.watch) - return; -@@ -6136,18 +6189,25 @@ ip_check_ping_watch_cb (GPid pid, gint status, gpointer user_data) - priv->gw_ping.pid = 0; - - if (WIFEXITED (status)) { -- if (WEXITSTATUS (status) == 0) -+ if (WEXITSTATUS (status) == 0) { - _LOGD (log_domain, "ping: gateway ping succeeded"); -- else { -+ success = TRUE; -+ } else { - _LOGW (log_domain, "ping: gateway ping failed with error code %d", - WEXITSTATUS (status)); - } - } else - _LOGW (log_domain, "ping: stopped unexpectedly with status %d", status); - -- /* We've got connectivity, proceed to pre_up */ -- ip_check_gw_ping_cleanup (self); -- ip_check_pre_up (self); -+ if (success) { -+ /* We've got connectivity, proceed to pre_up */ -+ ip_check_gw_ping_cleanup (self); -+ ip_check_pre_up (self); -+ } else { -+ /* If ping exited with an error it may have returned early, -+ * wait 1 second and restart it */ -+ priv->gw_ping.watch = g_timeout_add_seconds (1, respawn_ping_cb, self); -+ } - } - - static gboolean -@@ -6166,46 +6226,30 @@ ip_check_ping_timeout_cb (gpointer user_data) - } - - static gboolean --spawn_ping (NMDevice *self, -- guint log_domain, -+start_ping (NMDevice *self, -+ NMLogDomain log_domain, - const char *binary, - const char *address, - guint timeout) - { - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); -- const char *args[] = { binary, "-I", nm_device_get_ip_iface (self), "-c", "1", "-w", NULL, address, NULL }; -- GError *error = NULL; -- char *str_timeout; -- gs_free char *tmp_str = NULL; -- gboolean success; - - g_return_val_if_fail (priv->gw_ping.watch == 0, FALSE); - g_return_val_if_fail (priv->gw_ping.timeout == 0, FALSE); - -- args[6] = str_timeout = g_strdup_printf ("%u", timeout); -- -- _LOGD (log_domain, "ping: running '%s'", -- (tmp_str = g_strjoinv (" ", (gchar **) args))); -+ priv->gw_ping.log_domain = log_domain; -+ priv->gw_ping.address = g_strdup (address); -+ priv->gw_ping.binary = g_strdup (binary); -+ priv->gw_ping.deadline = timeout + 10; /* the proper termination is enforced by a timer */ - -- success = g_spawn_async ("/", -- (gchar **) args, -- NULL, -- G_SPAWN_DO_NOT_REAP_CHILD, -- nm_unblock_posix_signals, -- NULL, -- &priv->gw_ping.pid, -- &error); -- if (success) { -- priv->gw_ping.log_domain = log_domain; -+ if (spawn_ping (self)) { - priv->gw_ping.watch = g_child_watch_add (priv->gw_ping.pid, ip_check_ping_watch_cb, self); -- priv->gw_ping.timeout = g_timeout_add_seconds (timeout + 1, ip_check_ping_timeout_cb, self); -- } else { -- _LOGW (log_domain, "ping: could not spawn %s: %s", binary, error->message); -- g_clear_error (&error); -+ priv->gw_ping.timeout = g_timeout_add_seconds (timeout, ip_check_ping_timeout_cb, self); -+ return TRUE; - } - -- g_free (str_timeout); -- return success; -+ ip_check_gw_ping_cleanup (self); -+ return FALSE; - } - - static void -@@ -6258,7 +6302,7 @@ nm_device_start_ip_check (NMDevice *self) - } - - if (buf[0]) -- spawn_ping (self, log_domain, ping_binary, buf, timeout); -+ start_ping (self, log_domain, ping_binary, buf, timeout); - - /* If no ping was started, just advance to pre_up */ - if (!priv->gw_ping.pid) --- -2.4.3 - diff --git a/SOURCES/0009-rh1260584-nmcli-wol-fixes.patch b/SOURCES/0009-rh1260584-nmcli-wol-fixes.patch new file mode 100644 index 0000000..c521c2f --- /dev/null +++ b/SOURCES/0009-rh1260584-nmcli-wol-fixes.patch @@ -0,0 +1,193 @@ +From 65f6bb0b7b5baf9b92906ca5b0259f901bb57bb7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= +Date: Mon, 14 Sep 2015 14:06:39 +0200 +Subject: [PATCH 1/2] nmcli: allow "none" value for ethernet.wake-on-lan + property (rh #1260584) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Aliases "disable" and "disabled" are accepted too. + +nmcli> set 802-3-ethernet.wake-on-lan none + +It was possible to remove flags by setting a string containing just white +spaces, but it was user unfriendly and non-intuitive. + +https://bugzilla.redhat.com/show_bug.cgi?id=1260584 + +(cherry picked from commit f88ce92b2574b9f4388868d7f92a48ea71e93bb8) +Signed-off-by: Jiří Klimeš +--- + clients/cli/settings.c | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +diff --git a/clients/cli/settings.c b/clients/cli/settings.c +index 952681d..5ca80b4 100644 +--- a/clients/cli/settings.c ++++ b/clients/cli/settings.c +@@ -1541,11 +1541,17 @@ nmc_property_wired_set_wake_on_lan (NMSetting *setting, const char *prop, + (int *) &wol, &err_token); + + if (!ret) { +- g_set_error (error, 1, 0, _("invalid option '%s', use a combination of %s or 'default'"), +- err_token, +- nm_utils_enum_to_str (nm_setting_wired_wake_on_lan_get_type (), +- NM_SETTING_WIRED_WAKE_ON_LAN_ALL)); +- return FALSE; ++ if ( g_ascii_strcasecmp (err_token, "none") == 0 ++ || g_ascii_strcasecmp (err_token, "disable") == 0 ++ || g_ascii_strcasecmp (err_token, "disabled") == 0) ++ wol = NM_SETTING_WIRED_WAKE_ON_LAN_NONE; ++ else { ++ g_set_error (error, 1, 0, _("invalid option '%s', use a combination of %s or 'default' or 'none'"), ++ err_token, ++ nm_utils_enum_to_str (nm_setting_wired_wake_on_lan_get_type (), ++ NM_SETTING_WIRED_WAKE_ON_LAN_ALL)); ++ return FALSE; ++ } + } + + if (NM_FLAGS_HAS (wol, NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT) && +-- +2.1.0 + + +From c0c1cb1dc8bff47385fd00043196ce323a6cb770 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= +Date: Mon, 14 Sep 2015 14:23:50 +0200 +Subject: [PATCH 2/2] nmcli: wake-on-lan property set/get fixes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- accept a numeric value (decimal or hex (0x prefix)) +- display a numeric value of the property in addition to the strings +- add/accept spaces between string names + +to behave similar to other flags' properties. + +(cherry picked from commit 4485b4ec2fa22d588a75640573b06270031f5c77) +Signed-off-by: Jiří Klimeš +--- + clients/cli/settings.c | 42 ++++++++++++++++++++++++++--------------- + libnm-core/nm-utils.c | 4 ++-- + libnm-core/tests/test-general.c | 6 ++++-- + 3 files changed, 33 insertions(+), 19 deletions(-) + +diff --git a/clients/cli/settings.c b/clients/cli/settings.c +index 5ca80b4..8d2d70b 100644 +--- a/clients/cli/settings.c ++++ b/clients/cli/settings.c +@@ -1524,9 +1524,16 @@ nmc_property_wired_get_wake_on_lan (NMSetting *setting, NmcPropertyGetType get_t + { + NMSettingWired *s_wired = NM_SETTING_WIRED (setting); + NMSettingWiredWakeOnLan wol; ++ char *tmp, *str; + + wol = nm_setting_wired_get_wake_on_lan (s_wired); +- return nm_utils_enum_to_str (nm_setting_wired_wake_on_lan_get_type (), wol); ++ tmp = nm_utils_enum_to_str (nm_setting_wired_wake_on_lan_get_type (), wol); ++ if (get_type == NMC_PROPERTY_GET_PARSABLE) ++ str = g_strdup_printf ("%s", tmp && *tmp ? tmp : "none"); ++ else ++ str = g_strdup_printf ("%d (%s)", wol, tmp && *tmp ? tmp : "none"); ++ g_free (tmp); ++ return str; + } + + static gboolean +@@ -1536,21 +1543,26 @@ nmc_property_wired_set_wake_on_lan (NMSetting *setting, const char *prop, + NMSettingWiredWakeOnLan wol; + gs_free char *err_token = NULL; + gboolean ret; ++ long int t; + +- ret = nm_utils_enum_from_str (nm_setting_wired_wake_on_lan_get_type (), val, +- (int *) &wol, &err_token); +- +- if (!ret) { +- if ( g_ascii_strcasecmp (err_token, "none") == 0 +- || g_ascii_strcasecmp (err_token, "disable") == 0 +- || g_ascii_strcasecmp (err_token, "disabled") == 0) +- wol = NM_SETTING_WIRED_WAKE_ON_LAN_NONE; +- else { +- g_set_error (error, 1, 0, _("invalid option '%s', use a combination of %s or 'default' or 'none'"), +- err_token, +- nm_utils_enum_to_str (nm_setting_wired_wake_on_lan_get_type (), +- NM_SETTING_WIRED_WAKE_ON_LAN_ALL)); +- return FALSE; ++ if (nmc_string_to_int_base (val, 0, TRUE, 0, NM_SETTING_WIRED_WAKE_ON_LAN_ALL, &t)) ++ wol = (NMSettingWiredWakeOnLan) t; ++ else { ++ ret = nm_utils_enum_from_str (nm_setting_wired_wake_on_lan_get_type (), val, ++ (int *) &wol, &err_token); ++ ++ if (!ret) { ++ if ( g_ascii_strcasecmp (err_token, "none") == 0 ++ || g_ascii_strcasecmp (err_token, "disable") == 0 ++ || g_ascii_strcasecmp (err_token, "disabled") == 0) ++ wol = NM_SETTING_WIRED_WAKE_ON_LAN_NONE; ++ else { ++ g_set_error (error, 1, 0, _("invalid option '%s', use a combination of [%s] or 'default' or 'none'"), ++ err_token, ++ nm_utils_enum_to_str (nm_setting_wired_wake_on_lan_get_type (), ++ NM_SETTING_WIRED_WAKE_ON_LAN_ALL)); ++ return FALSE; ++ } + } + } + +diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c +index 66dd1c8..987cf73 100644 +--- a/libnm-core/nm-utils.c ++++ b/libnm-core/nm-utils.c +@@ -3676,7 +3676,7 @@ char *nm_utils_enum_to_str (GType type, int value) + break; + + if (!first) +- g_string_append_c (str, ','); ++ g_string_append (str, ", "); + g_string_append (str, flags_value->value_nick); + + value &= ~flags_value->value; +@@ -3733,7 +3733,7 @@ gboolean nm_utils_enum_from_str (GType type, const char *str, + gs_strfreev char **strv = NULL; + int i; + +- strv = g_strsplit (stripped, ",", 0); ++ strv = g_strsplit_set (stripped, " \t,", 0); + for (i = 0; strv[i]; i++) { + if (!strv[i][0]) + continue; +diff --git a/libnm-core/tests/test-general.c b/libnm-core/tests/test-general.c +index a73604b..42b55c1 100644 +--- a/libnm-core/tests/test-general.c ++++ b/libnm-core/tests/test-general.c +@@ -4582,12 +4582,12 @@ static void test_nm_utils_enum (void) + test_nm_utils_enum_to_str_do (meta_flags, NM_TEST_GENERAL_META_FLAGS_BAZ, "baz"); + test_nm_utils_enum_to_str_do (meta_flags, NM_TEST_GENERAL_META_FLAGS_FOO | + NM_TEST_GENERAL_META_FLAGS_BAR | +- NM_TEST_GENERAL_META_FLAGS_BAZ, "foo,bar,baz"); ++ NM_TEST_GENERAL_META_FLAGS_BAZ, "foo, bar, baz"); + + test_nm_utils_enum_to_str_do (color_flags, NM_TEST_GENERAL_COLOR_FLAGS_RED, "red"); + test_nm_utils_enum_to_str_do (color_flags, NM_TEST_GENERAL_COLOR_FLAGS_WHITE, ""); + test_nm_utils_enum_to_str_do (color_flags, NM_TEST_GENERAL_COLOR_FLAGS_RED | +- NM_TEST_GENERAL_COLOR_FLAGS_GREEN, "red,green"); ++ NM_TEST_GENERAL_COLOR_FLAGS_GREEN, "red, green"); + + test_nm_utils_enum_from_str_do (bool_enum, "", FALSE, 0, NULL); + test_nm_utils_enum_from_str_do (bool_enum, " ", FALSE, 0, NULL); +@@ -4601,6 +4601,8 @@ static void test_nm_utils_enum (void) + test_nm_utils_enum_from_str_do (meta_flags, "foo", TRUE, NM_TEST_GENERAL_META_FLAGS_FOO, NULL); + test_nm_utils_enum_from_str_do (meta_flags, "foo,baz", TRUE, NM_TEST_GENERAL_META_FLAGS_FOO | + NM_TEST_GENERAL_META_FLAGS_BAZ, NULL); ++ test_nm_utils_enum_from_str_do (meta_flags, "foo, baz", TRUE, NM_TEST_GENERAL_META_FLAGS_FOO | ++ NM_TEST_GENERAL_META_FLAGS_BAZ, NULL); + test_nm_utils_enum_from_str_do (meta_flags, "foo,,bar", TRUE, NM_TEST_GENERAL_META_FLAGS_FOO | + NM_TEST_GENERAL_META_FLAGS_BAR, NULL); + test_nm_utils_enum_from_str_do (meta_flags, "foo,baz,quux,bar", FALSE, 0, "quux"); +-- +2.1.0 + diff --git a/SOURCES/0010-rh1246496-retry-dhcp-assumed-connections.patch b/SOURCES/0010-rh1246496-retry-dhcp-assumed-connections.patch new file mode 100644 index 0000000..ef8fc10 --- /dev/null +++ b/SOURCES/0010-rh1246496-retry-dhcp-assumed-connections.patch @@ -0,0 +1,62 @@ +From d381c50724079e3a774892db70146269697ee1ef Mon Sep 17 00:00:00 2001 +From: Beniamino Galvani +Date: Wed, 2 Sep 2015 10:14:35 +0200 +Subject: [PATCH] device: retry DHCP after timeout/expiration for assumed + connections + +If DHCP fails for an assumed connection, NetworkManager would +transition the device to the FAILED and then to the ACTIVATED state +(because it is assumed); hence if the DHCP server goes temporarily +down the device will go into a permanent state without IP +configuration. + +Fix this and try DHCP again after some time when the connection +is an assumed one. + +https://bugzilla.redhat.com/show_bug.cgi?id=1246496 +(cherry picked from commit 2b9db2bf1b9f12586381d90a653bfe7c92f0d7e7) +--- + src/devices/nm-device.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index d75bf5e..3a7d991 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -3467,6 +3467,16 @@ dhcp4_fail (NMDevice *self, gboolean timeout) + return; + } + ++ /* Instead of letting an assumed connection fail (which means that the ++ * device will transition to the ACTIVATED state without IP configuration), ++ * retry DHCP again. ++ */ ++ if (nm_device_uses_assumed_connection (self)) { ++ _LOGI (LOGD_DHCP4, "Scheduling DHCPv4 restart because the connection is assumed"); ++ priv->dhcp4_restart_id = g_timeout_add_seconds (120, dhcp4_restart_cb, self); ++ return; ++ } ++ + if (timeout || (priv->ip4_state == IP_CONF)) + nm_device_activate_schedule_ip4_config_timeout (self); + else if (priv->ip4_state == IP_DONE) +@@ -4141,6 +4151,16 @@ dhcp6_fail (NMDevice *self, gboolean timeout) + return; + } + ++ /* Instead of letting an assumed connection fail (which means that the ++ * device will transition to the ACTIVATED state without IP configuration), ++ * retry DHCP again. ++ */ ++ if (nm_device_uses_assumed_connection (self)) { ++ _LOGI (LOGD_DHCP6, "Scheduling DHCPv6 restart because the connection is assumed"); ++ priv->dhcp6_restart_id = g_timeout_add_seconds (120, dhcp6_restart_cb, self); ++ return; ++ } ++ + if (timeout || (priv->ip6_state == IP_CONF)) + nm_device_activate_schedule_ip6_config_timeout (self); + else if (priv->ip6_state == IP_DONE) +-- +2.4.3 + diff --git a/SOURCES/0011-rh1254089-retry-generation-of-default-connection.patch b/SOURCES/0011-rh1254089-retry-generation-of-default-connection.patch new file mode 100644 index 0000000..d35a5f1 --- /dev/null +++ b/SOURCES/0011-rh1254089-retry-generation-of-default-connection.patch @@ -0,0 +1,113 @@ +From 80d4fbf4ace3d8ed4428e17b0920ec32bdaf4fe1 Mon Sep 17 00:00:00 2001 +From: Beniamino Galvani +Date: Thu, 3 Sep 2015 16:51:39 +0200 +Subject: [PATCH] device: retry creation of default connection after link is + initialized + +When a new link is detected, NM tries to generate a default "Wired +connection" in nm_settings_device_added(), but if the link has not +been initialized by udev yet the function returns early because +priv->unmanaged_flags = UNMANAGED_PLATFORM_INIT. + +To be sure that a default connection is created is such situation, we +need to call again nm_settings_device_added() after link +initialization. + +https://bugzilla.redhat.com/show_bug.cgi?id=1254089 +(cherry picked from commit b3b0b4625053d5647e2756bbe745652889684a21) +--- + src/devices/nm-device.c | 10 ++++++++++ + src/devices/nm-device.h | 1 + + src/nm-manager.c | 15 +++++++++++++++ + 3 files changed, 26 insertions(+) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index 3a7d991..c5924a6 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -95,6 +95,7 @@ enum { + REMOVED, + RECHECK_AUTO_ACTIVATE, + RECHECK_ASSUME, ++ LINK_INITIALIZED, + LAST_SIGNAL, + }; + static guint signals[LAST_SIGNAL] = { 0 }; +@@ -1505,6 +1506,8 @@ device_link_changed (NMDevice *self) + NM_UNMANAGED_PLATFORM_INIT, + FALSE, + NM_DEVICE_STATE_REASON_NOW_MANAGED); ++ ++ g_signal_emit (self, signals[LINK_INITIALIZED], 0); + } + + return G_SOURCE_REMOVE; +@@ -9837,6 +9840,13 @@ nm_device_class_init (NMDeviceClass *klass) + 0, NULL, NULL, NULL, + G_TYPE_NONE, 0); + ++ signals[LINK_INITIALIZED] = ++ g_signal_new (NM_DEVICE_LINK_INITIALIZED, ++ G_OBJECT_CLASS_TYPE (object_class), ++ G_SIGNAL_RUN_FIRST, ++ 0, NULL, NULL, NULL, ++ G_TYPE_NONE, 0); ++ + nm_dbus_manager_register_exported_type (nm_dbus_manager_get (), + G_TYPE_FROM_CLASS (klass), + &dbus_glib_nm_device_object_info); +diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h +index e9d5b94..49cef8e 100644 +--- a/src/devices/nm-device.h ++++ b/src/devices/nm-device.h +@@ -74,6 +74,7 @@ + #define NM_DEVICE_REMOVED "removed" + #define NM_DEVICE_RECHECK_AUTO_ACTIVATE "recheck-auto-activate" + #define NM_DEVICE_RECHECK_ASSUME "recheck-assume" ++#define NM_DEVICE_LINK_INITIALIZED "link-initialized" + + G_BEGIN_DECLS + +diff --git a/src/nm-manager.c b/src/nm-manager.c +index 34ec081..d91a0d7 100644 +--- a/src/nm-manager.c ++++ b/src/nm-manager.c +@@ -853,6 +853,14 @@ device_removed_cb (NMDevice *device, gpointer user_data) + } + + static void ++device_link_initialized_cb (NMDevice *device, gpointer user_data) ++{ ++ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (user_data); ++ ++ nm_settings_device_added (priv->settings, device); ++} ++ ++static void + aipd_handle_event (DBusGProxy *proxy, + const char *event, + const char *iface, +@@ -1813,6 +1821,10 @@ add_device (NMManager *self, NMDevice *device, gboolean try_assume) + G_CALLBACK (device_removed_cb), + self); + ++ g_signal_connect (device, NM_DEVICE_LINK_INITIALIZED, ++ G_CALLBACK (device_link_initialized_cb), ++ self); ++ + g_signal_connect (device, "notify::" NM_DEVICE_IP_IFACE, + G_CALLBACK (device_ip_iface_changed), + self); +@@ -1871,6 +1883,9 @@ add_device (NMManager *self, NMDevice *device, gboolean try_assume) + NM_DEVICE_STATE_REASON_NOW_MANAGED); + } + ++ /* Try to generate a default connection. If this fails because the link is ++ * not initialized, we will retry again in device_link_initialized_cb(). ++ */ + nm_settings_device_added (priv->settings, device); + g_signal_emit (self, signals[DEVICE_ADDED], 0, device); + g_object_notify (G_OBJECT (self), NM_MANAGER_DEVICES); +-- +2.4.3 + diff --git a/SOURCES/0012-rh1262972-ifcfg-rh-network-GATEWAY.patch b/SOURCES/0012-rh1262972-ifcfg-rh-network-GATEWAY.patch new file mode 100644 index 0000000..25172b2 --- /dev/null +++ b/SOURCES/0012-rh1262972-ifcfg-rh-network-GATEWAY.patch @@ -0,0 +1,575 @@ +From 12af09b779d70979516529c63633b7d296f82b47 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 3 Sep 2015 18:15:46 +0200 +Subject: [PATCH] test: fix duplicate test names +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +New glib complains. + +(cherry picked from commit 874f455d6d47c5a34ed9861a6710f4b78202e0d6) +Signed-off-by: Jiří Klimeš +--- + libnm-core/tests/test-general.c | 20 +-- + src/devices/wifi/tests/test-wifi-ap-utils.c | 137 +++++++-------------- + .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 14 +-- + 3 files changed, 62 insertions(+), 109 deletions(-) + +diff --git a/libnm-core/tests/test-general.c b/libnm-core/tests/test-general.c +index e948365..a73604b 100644 +--- a/libnm-core/tests/test-general.c ++++ b/libnm-core/tests/test-general.c +@@ -4637,18 +4637,18 @@ int main (int argc, char **argv) + g_test_add_func ("/core/general/test_setting_to_dbus_enum", test_setting_to_dbus_enum); + g_test_add_func ("/core/general/test_setting_compare_id", test_setting_compare_id); + g_test_add_func ("/core/general/test_setting_compare_timestamp", test_setting_compare_timestamp); +-#define ADD_FUNC(func, secret_flags, comp_flags, remove_secret) \ +- g_test_add_data_func_full ("/core/general/" G_STRINGIFY (func), \ ++#define ADD_FUNC(name, func, secret_flags, comp_flags, remove_secret) \ ++ g_test_add_data_func_full ("/core/general/" G_STRINGIFY (func) "_" name, \ + test_data_compare_secrets_new (secret_flags, comp_flags, remove_secret), \ + func, g_free) +- ADD_FUNC (test_setting_compare_secrets, NM_SETTING_SECRET_FLAG_AGENT_OWNED, NM_SETTING_COMPARE_FLAG_IGNORE_AGENT_OWNED_SECRETS, TRUE); +- ADD_FUNC (test_setting_compare_secrets, NM_SETTING_SECRET_FLAG_NOT_SAVED, NM_SETTING_COMPARE_FLAG_IGNORE_NOT_SAVED_SECRETS, TRUE); +- ADD_FUNC (test_setting_compare_secrets, NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS, TRUE); +- ADD_FUNC (test_setting_compare_secrets, NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_COMPARE_FLAG_EXACT, FALSE); +- ADD_FUNC (test_setting_compare_vpn_secrets, NM_SETTING_SECRET_FLAG_AGENT_OWNED, NM_SETTING_COMPARE_FLAG_IGNORE_AGENT_OWNED_SECRETS, TRUE); +- ADD_FUNC (test_setting_compare_vpn_secrets, NM_SETTING_SECRET_FLAG_NOT_SAVED, NM_SETTING_COMPARE_FLAG_IGNORE_NOT_SAVED_SECRETS, TRUE); +- ADD_FUNC (test_setting_compare_vpn_secrets, NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS, TRUE); +- ADD_FUNC (test_setting_compare_vpn_secrets, NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_COMPARE_FLAG_EXACT, FALSE); ++ ADD_FUNC ("agent_owned", test_setting_compare_secrets, NM_SETTING_SECRET_FLAG_AGENT_OWNED, NM_SETTING_COMPARE_FLAG_IGNORE_AGENT_OWNED_SECRETS, TRUE); ++ ADD_FUNC ("not_saved", test_setting_compare_secrets, NM_SETTING_SECRET_FLAG_NOT_SAVED, NM_SETTING_COMPARE_FLAG_IGNORE_NOT_SAVED_SECRETS, TRUE); ++ ADD_FUNC ("secrets", test_setting_compare_secrets, NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS, TRUE); ++ ADD_FUNC ("exact", test_setting_compare_secrets, NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_COMPARE_FLAG_EXACT, FALSE); ++ ADD_FUNC ("agent_owned", test_setting_compare_vpn_secrets, NM_SETTING_SECRET_FLAG_AGENT_OWNED, NM_SETTING_COMPARE_FLAG_IGNORE_AGENT_OWNED_SECRETS, TRUE); ++ ADD_FUNC ("not_saved", test_setting_compare_vpn_secrets, NM_SETTING_SECRET_FLAG_NOT_SAVED, NM_SETTING_COMPARE_FLAG_IGNORE_NOT_SAVED_SECRETS, TRUE); ++ ADD_FUNC ("secrets", test_setting_compare_vpn_secrets, NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS, TRUE); ++ ADD_FUNC ("exact", test_setting_compare_vpn_secrets, NM_SETTING_SECRET_FLAG_NONE, NM_SETTING_COMPARE_FLAG_EXACT, FALSE); + g_test_add_func ("/core/general/test_setting_old_uuid", test_setting_old_uuid); + + g_test_add_func ("/core/general/test_connection_to_dbus_setting_name", test_connection_to_dbus_setting_name); +diff --git a/src/devices/wifi/tests/test-wifi-ap-utils.c b/src/devices/wifi/tests/test-wifi-ap-utils.c +index 3c405e2..a5dc545 100644 +--- a/src/devices/wifi/tests/test-wifi-ap-utils.c ++++ b/src/devices/wifi/tests/test-wifi-ap-utils.c +@@ -1364,10 +1364,10 @@ main (int argc, char **argv) + test_open_ap_leap_connection_1); + g_test_add_func ("/wifi/open_ap/leap_connection/2", + test_open_ap_leap_connection_2); +- g_test_add_data_func ("/wifi/open_ap/wep_connection", ++ g_test_add_data_func ("/wifi/open_ap/wep_connection_true", + (gconstpointer) TRUE, + test_open_ap_wep_connection); +- g_test_add_data_func ("/wifi/open_ap/wep_connection", ++ g_test_add_data_func ("/wifi/open_ap/wep_connection_false", + (gconstpointer) FALSE, + test_open_ap_wep_connection); + +@@ -1441,104 +1441,57 @@ main (int argc, char **argv) + (gconstpointer) IDX_PRIV, + test_ap_wpa_eap_connection_5); + ++#define ADD_FUNC(func) do { \ ++ gchar *name_idx = g_strdup_printf ("/wifi/wpa_psk/" G_STRINGIFY (func) "/%ld", i); \ ++ g_test_add_data_func (name_idx, (gconstpointer) i, func); \ ++ g_free (name_idx); \ ++ } while (0) ++ + /* WPA-PSK tests */ + for (i = IDX_WPA_PSK_PTKIP_GTKIP; i <= IDX_WPA_RSN_PSK_PCCMP_GCCMP; i++) { +- g_test_add_data_func ("/wifi/wpa_psk/empty_connection", +- (gconstpointer) i, +- test_wpa_ap_empty_connection); +- g_test_add_data_func ("/wifi/wpa_psk/leap_connection/1", +- (gconstpointer) i, +- test_wpa_ap_leap_connection_1); +- g_test_add_data_func ("/wifi/wpa_psk/leap_connection/2", +- (gconstpointer) i, +- test_wpa_ap_leap_connection_2); +- +- g_test_add_data_func ("/wifi/wpa_psk/dynamic_wep_connection", +- (gconstpointer) i, +- test_wpa_ap_dynamic_wep_connection); +- +- g_test_add_data_func ("/wifi/wpa_psk/wpa_psk_connection/1", +- (gconstpointer) i, +- test_wpa_ap_wpa_psk_connection_1); +- g_test_add_data_func ("/wifi/wpa_psk/wpa_psk_connection/2", +- (gconstpointer) i, +- test_wpa_ap_wpa_psk_connection_2); +- g_test_add_data_func ("/wifi/wpa_psk/wpa_psk_connection/3", +- (gconstpointer) i, +- test_wpa_ap_wpa_psk_connection_3); +- g_test_add_data_func ("/wifi/wpa_psk/wpa_psk_connection/4", +- (gconstpointer) i, +- test_wpa_ap_wpa_psk_connection_4); +- g_test_add_data_func ("/wifi/wpa_psk/wpa_psk_connection/5", +- (gconstpointer) i, +- test_wpa_ap_wpa_psk_connection_5); +- +- g_test_add_data_func ("/wifi/wpa_psk/wpa_eap_connection/1", +- (gconstpointer) i, +- test_ap_wpa_eap_connection_1); +- g_test_add_data_func ("/wifi/wpa_psk/wpa_eap_connection/2", +- (gconstpointer) i, +- test_ap_wpa_eap_connection_2); +- g_test_add_data_func ("/wifi/wpa_psk/wpa_eap_connection/3", +- (gconstpointer) i, +- test_ap_wpa_eap_connection_3); +- g_test_add_data_func ("/wifi/wpa_psk/wpa_eap_connection/4", +- (gconstpointer) i, +- test_ap_wpa_eap_connection_4); +- g_test_add_data_func ("/wifi/wpa_psk/wpa_eap_connection/5", +- (gconstpointer) i, +- test_ap_wpa_eap_connection_5); ++ ADD_FUNC(test_wpa_ap_empty_connection); ++ ADD_FUNC(test_wpa_ap_leap_connection_1); ++ ADD_FUNC(test_wpa_ap_leap_connection_2); ++ ADD_FUNC(test_wpa_ap_dynamic_wep_connection); ++ ADD_FUNC(test_wpa_ap_wpa_psk_connection_1); ++ ADD_FUNC(test_wpa_ap_wpa_psk_connection_2); ++ ADD_FUNC(test_wpa_ap_wpa_psk_connection_3); ++ ADD_FUNC(test_wpa_ap_wpa_psk_connection_4); ++ ADD_FUNC(test_wpa_ap_wpa_psk_connection_5); ++ ADD_FUNC(test_ap_wpa_eap_connection_1); ++ ADD_FUNC(test_ap_wpa_eap_connection_2); ++ ADD_FUNC(test_ap_wpa_eap_connection_3); ++ ADD_FUNC(test_ap_wpa_eap_connection_4); ++ ADD_FUNC(test_ap_wpa_eap_connection_5); + } + ++#undef ADD_FUNC ++#define ADD_FUNC(func) do { \ ++ gchar *name_idx = g_strdup_printf ("/wifi/rsn_psk/" G_STRINGIFY (func) "/%ld", i); \ ++ g_test_add_data_func (name_idx, (gconstpointer) i, func); \ ++ g_free (name_idx); \ ++ } while (0) ++ + /* RSN-PSK tests */ + for (i = IDX_WPA_RSN_PSK_PTKIP_PCCMP_GTKIP; i <= IDX_RSN_PSK_PTKIP_PCCMP_GTKIP; i++) { +- g_test_add_data_func ("/wifi/rsn_psk/empty_connection", +- (gconstpointer) i, +- test_wpa_ap_empty_connection); +- g_test_add_data_func ("/wifi/rsn_psk/leap_connection/1", +- (gconstpointer) i, +- test_wpa_ap_leap_connection_1); +- g_test_add_data_func ("/wifi/rsn_psk/leap_connection/2", +- (gconstpointer) i, +- test_wpa_ap_leap_connection_2); +- +- g_test_add_data_func ("/wifi/rsn_psk/dynamic_wep_connection", +- (gconstpointer) i, +- test_wpa_ap_dynamic_wep_connection); +- +- g_test_add_data_func ("/wifi/rsn_psk/wpa_psk_connection/1", +- (gconstpointer) i, +- test_wpa_ap_wpa_psk_connection_1); +- g_test_add_data_func ("/wifi/rsn_psk/wpa_psk_connection/2", +- (gconstpointer) i, +- test_wpa_ap_wpa_psk_connection_2); +- g_test_add_data_func ("/wifi/rsn_psk/wpa_psk_connection/3", +- (gconstpointer) i, +- test_wpa_ap_wpa_psk_connection_3); +- g_test_add_data_func ("/wifi/rsn_psk/wpa_psk_connection/4", +- (gconstpointer) i, +- test_wpa_ap_wpa_psk_connection_4); +- g_test_add_data_func ("/wifi/rsn_psk/wpa_psk_connection/5", +- (gconstpointer) i, +- test_wpa_ap_wpa_psk_connection_5); +- +- g_test_add_data_func ("/wifi/rsn_psk/wpa_eap_connection/1", +- (gconstpointer) i, +- test_ap_wpa_eap_connection_1); +- g_test_add_data_func ("/wifi/rsn_psk/wpa_eap_connection/2", +- (gconstpointer) i, +- test_ap_wpa_eap_connection_2); +- g_test_add_data_func ("/wifi/rsn_psk/wpa_eap_connection/3", +- (gconstpointer) i, +- test_ap_wpa_eap_connection_3); +- g_test_add_data_func ("/wifi/rsn_psk/wpa_eap_connection/4", +- (gconstpointer) i, +- test_ap_wpa_eap_connection_4); +- g_test_add_data_func ("/wifi/rsn_psk/wpa_eap_connection/5", +- (gconstpointer) i, +- test_ap_wpa_eap_connection_5); ++ ADD_FUNC(test_wpa_ap_empty_connection); ++ ADD_FUNC(test_wpa_ap_leap_connection_1); ++ ADD_FUNC(test_wpa_ap_leap_connection_2); ++ ADD_FUNC(test_wpa_ap_dynamic_wep_connection); ++ ADD_FUNC(test_wpa_ap_wpa_psk_connection_1); ++ ADD_FUNC(test_wpa_ap_wpa_psk_connection_2); ++ ADD_FUNC(test_wpa_ap_wpa_psk_connection_3); ++ ADD_FUNC(test_wpa_ap_wpa_psk_connection_4); ++ ADD_FUNC(test_wpa_ap_wpa_psk_connection_5); ++ ADD_FUNC(test_ap_wpa_eap_connection_1); ++ ADD_FUNC(test_ap_wpa_eap_connection_2); ++ ADD_FUNC(test_ap_wpa_eap_connection_3); ++ ADD_FUNC(test_ap_wpa_eap_connection_4); ++ ADD_FUNC(test_ap_wpa_eap_connection_5); + } + ++#undef ADD_FUNC ++ + /* Scanned signal strength conversion tests */ + g_test_add_func ("/wifi/strength/dbm", + test_strength_dbm); +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 f2f85d3..953b0c7 100644 +--- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c ++++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +@@ -12604,12 +12604,12 @@ int main (int argc, char **argv) + test_read_wired_static (TEST_IFCFG_WIRED_STATIC, "System test-wired-static", TRUE); + test_read_wired_static (TEST_IFCFG_WIRED_STATIC_BOOTPROTO, "System test-wired-static-bootproto", FALSE); + test_read_wired_dhcp (); +- g_test_add_func (TPATH "dhcp-plus-ip", test_read_wired_dhcp_plus_ip); +- g_test_add_func (TPATH "shared-plus-ip", test_read_wired_shared_plus_ip); +- g_test_add_func (TPATH "dhcp-send-hostname", test_read_write_wired_dhcp_send_hostname); +- g_test_add_func (TPATH "global-gateway", test_read_wired_global_gateway); +- g_test_add_func (TPATH "obsolete-gateway-n", test_read_wired_obsolete_gateway_n); +- g_test_add_func (TPATH "never-default", test_read_wired_never_default); ++ g_test_add_func (TPATH "read-dhcp-plus-ip", test_read_wired_dhcp_plus_ip); ++ g_test_add_func (TPATH "read-shared-plus-ip", test_read_wired_shared_plus_ip); ++ g_test_add_func (TPATH "read-dhcp-send-hostname", test_read_write_wired_dhcp_send_hostname); ++ g_test_add_func (TPATH "read-global-gateway", test_read_wired_global_gateway); ++ g_test_add_func (TPATH "read-obsolete-gateway-n", test_read_wired_obsolete_gateway_n); ++ g_test_add_func (TPATH "read-never-default", test_read_wired_never_default); + test_read_wired_defroute_no (); + test_read_wired_defroute_no_gatewaydev_yes (); + g_test_add_func (TPATH "routes/read-static", test_read_wired_static_routes); +@@ -12679,7 +12679,7 @@ int main (int argc, char **argv) + test_write_wired_static_routes (); + test_read_write_static_routes_legacy (); + test_write_wired_dhcp (); +- g_test_add_func (TPATH "dhcp-plus-ip", test_write_wired_dhcp_plus_ip); ++ g_test_add_func (TPATH "wired/write-dhcp-plus-ip", test_write_wired_dhcp_plus_ip); + test_write_wired_dhcp_8021x_peap_mschapv2 (); + test_write_wired_8021x_tls (NM_SETTING_802_1X_CK_SCHEME_PATH, NM_SETTING_SECRET_FLAG_AGENT_OWNED); + test_write_wired_8021x_tls (NM_SETTING_802_1X_CK_SCHEME_PATH, NM_SETTING_SECRET_FLAG_NOT_SAVED); +-- +2.1.0 + + +From 317b6cb880b6afbb11a6578bc3791cb6eba5f2e7 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Fri, 4 Sep 2015 12:49:54 +0200 +Subject: [PATCH] tests: fix 32-bit build +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes: 874f455d6d47c5a34ed9861a6710f4b78202e0d6 +(cherry picked from commit f71f9d5fcf5726f9be5ac0c97e7dbc26c3e57ecc) +Signed-off-by: Jiří Klimeš +--- + src/devices/wifi/tests/test-wifi-ap-utils.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/devices/wifi/tests/test-wifi-ap-utils.c b/src/devices/wifi/tests/test-wifi-ap-utils.c +index a5dc545..26e130c 100644 +--- a/src/devices/wifi/tests/test-wifi-ap-utils.c ++++ b/src/devices/wifi/tests/test-wifi-ap-utils.c +@@ -1442,7 +1442,7 @@ main (int argc, char **argv) + test_ap_wpa_eap_connection_5); + + #define ADD_FUNC(func) do { \ +- gchar *name_idx = g_strdup_printf ("/wifi/wpa_psk/" G_STRINGIFY (func) "/%ld", i); \ ++ gchar *name_idx = g_strdup_printf ("/wifi/wpa_psk/" G_STRINGIFY (func) "/%zd", i); \ + g_test_add_data_func (name_idx, (gconstpointer) i, func); \ + g_free (name_idx); \ + } while (0) +@@ -1467,7 +1467,7 @@ main (int argc, char **argv) + + #undef ADD_FUNC + #define ADD_FUNC(func) do { \ +- gchar *name_idx = g_strdup_printf ("/wifi/rsn_psk/" G_STRINGIFY (func) "/%ld", i); \ ++ gchar *name_idx = g_strdup_printf ("/wifi/rsn_psk/" G_STRINGIFY (func) "/%zd", i); \ + g_test_add_data_func (name_idx, (gconstpointer) i, func); \ + g_free (name_idx); \ + } while (0) +-- +2.1.0 + + +From 827b49f0894168197096f3e2249b5f621b94617a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= +Date: Tue, 15 Sep 2015 15:27:25 +0200 +Subject: [PATCH 1/2] ifcfg-rh: (trivial) remove unused network_file parameter +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +(cherry picked from commit 64e3873faf290f07404745ec3b78348c4527bcd6) +Signed-off-by: Jiří Klimeš +--- + src/settings/plugins/ifcfg-rh/reader.c | 19 +++++++------------ + 1 file changed, 7 insertions(+), 12 deletions(-) + +diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c +index 72123e6..1c0f55c 100644 +--- a/src/settings/plugins/ifcfg-rh/reader.c ++++ b/src/settings/plugins/ifcfg-rh/reader.c +@@ -346,7 +346,6 @@ is_any_ip4_address_defined (shvarFile *ifcfg, int *idx) + /* Returns TRUE on missing address or valid address */ + static gboolean + read_full_ip4_address (shvarFile *ifcfg, +- const char *network_file, + gint32 which, + NMIPAddress *base_addr, + NMIPAddress **out_address, +@@ -362,7 +361,6 @@ read_full_ip4_address (shvarFile *ifcfg, + + g_return_val_if_fail (which >= -1, FALSE); + g_return_val_if_fail (ifcfg != NULL, FALSE); +- g_return_val_if_fail (network_file != NULL, FALSE); + g_return_val_if_fail (out_address != NULL, FALSE); + g_return_val_if_fail (*out_address == NULL, FALSE); + if (error) +@@ -452,7 +450,6 @@ done: + /* Returns TRUE on missing route or valid route */ + static gboolean + read_one_ip4_route (shvarFile *ifcfg, +- const char *network_file, + guint32 which, + NMIPRoute **out_route, + GError **error) +@@ -463,7 +460,6 @@ read_one_ip4_route (shvarFile *ifcfg, + gboolean success = FALSE; + + g_return_val_if_fail (ifcfg != NULL, FALSE); +- g_return_val_if_fail (network_file != NULL, FALSE); + g_return_val_if_fail (out_route != NULL, FALSE); + g_return_val_if_fail (*out_route == NULL, FALSE); + if (error) +@@ -684,7 +680,6 @@ error: + + static gboolean + parse_full_ip6_address (shvarFile *ifcfg, +- const char *network_file, + const char *addr_str, + int i, + NMIPAddress **out_address, +@@ -962,7 +957,7 @@ make_ip4_setting (shvarFile *ifcfg, + if (is_any_ip4_address_defined (ifcfg, &idx)) { + NMIPAddress *addr = NULL; + +- if (!read_full_ip4_address (ifcfg, network_file, idx, NULL, &addr, NULL, error)) ++ if (!read_full_ip4_address (ifcfg, idx, NULL, &addr, NULL, error)) + goto done; + if (!read_ip4_address (ifcfg, "GATEWAY", &gateway, error)) + goto done; +@@ -1020,7 +1015,7 @@ make_ip4_setting (shvarFile *ifcfg, + + /* gateway will only be set if still unset. Hence, we don't leak gateway + * here by calling read_full_ip4_address() repeatedly */ +- if (!read_full_ip4_address (ifcfg, network_file, i, NULL, &addr, &gateway, error)) ++ if (!read_full_ip4_address (ifcfg, i, NULL, &addr, &gateway, error)) + goto done; + + if (!addr) { +@@ -1108,7 +1103,7 @@ make_ip4_setting (shvarFile *ifcfg, + for (i = 0; i < 256; i++) { + NMIPRoute *route = NULL; + +- if (!read_one_ip4_route (route_ifcfg, network_file, i, &route, error)) { ++ if (!read_one_ip4_route (route_ifcfg, i, &route, error)) { + svCloseFile (route_ifcfg); + goto done; + } +@@ -1158,7 +1153,7 @@ done: + } + + static void +-read_aliases (NMSettingIPConfig *s_ip4, const char *filename, const char *network_file) ++read_aliases (NMSettingIPConfig *s_ip4, const char *filename) + { + GDir *dir; + char *dirname, *base; +@@ -1230,7 +1225,7 @@ read_aliases (NMSettingIPConfig *s_ip4, const char *filename, const char *networ + } + + addr = NULL; +- ok = read_full_ip4_address (parsed, network_file, -1, base_addr, &addr, NULL, &err); ++ ok = read_full_ip4_address (parsed, -1, base_addr, &addr, NULL, &err); + svCloseFile (parsed); + if (ok) { + nm_ip_address_set_attribute (addr, "label", g_variant_new_string (device)); +@@ -1417,7 +1412,7 @@ make_ip6_setting (shvarFile *ifcfg, + for (iter = list, i = 0; iter && *iter; iter++, i++) { + NMIPAddress *addr = NULL; + +- if (!parse_full_ip6_address (ifcfg, network_file, *iter, i, &addr, error)) { ++ if (!parse_full_ip6_address (ifcfg, *iter, i, &addr, error)) { + g_strfreev (list); + goto error; + } +@@ -4884,7 +4879,7 @@ connection_from_file_full (const char *filename, + connection = NULL; + goto done; + } else { +- read_aliases (NM_SETTING_IP_CONFIG (s_ip4), filename, network_file); ++ read_aliases (NM_SETTING_IP_CONFIG (s_ip4), filename); + nm_connection_add_setting (connection, s_ip4); + } + +-- +2.1.0 + + +From 0aa99069ed8a241ca2ae8c9a156a8774132c9c7d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= +Date: Tue, 15 Sep 2015 16:54:09 +0200 +Subject: [PATCH 2/2] ifcfg-rh: ignore GATEWAY from network file for DHCP + connections (rh #1262972) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The GATEWAY from /etc/sysconfig/network file is used as a default value when +no GATEWAY is in ifcfg file. However, we have to ignore that GATEWAY for +connections without static addresses. Otherwise such connections would be +invalid and would disappear after restart/reaload. + +Some notes: +Putting GATEWAY into /etc/sysconfig/network is not recommended, because it +inherently belongs to the ifcfg file as it is a per-interface property. +The recommended practice is to specify GATEWAY in individual ifcfg files and +define DEFROUTE=no if the interface should not get the default route. +But we continue to read GATEWAY from /etc/sysconfig/network for compatibility +reasons. +See also +https://bugzilla.redhat.com/show_bug.cgi?id=896198#c25 +https://bugzilla.redhat.com/show_bug.cgi?id=896198#c27 + +Fixes: f17699f4e3dacb9358a8503c8b15efe3cb852b48 + +https://bugzilla.redhat.com/show_bug.cgi?id=1262972 + +(cherry picked from commit ed85fcc711ca4ff6fa394e92ac33c5ead5c460f5) +Signed-off-by: Jiří Klimeš +--- + src/settings/plugins/ifcfg-rh/reader.c | 7 ++++ + .../ifcfg-rh/tests/network-scripts/Makefile.am | 2 + + .../ifcfg-test-wired-global-gateway-ignore | 8 ++++ + .../network-test-wired-global-gateway-ignore | 1 + + .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 43 ++++++++++++++++++++++ + 5 files changed, 61 insertions(+) + create mode 100644 src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-global-gateway-ignore + create mode 100644 src/settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-global-gateway-ignore + +diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c +index 1c0f55c..5bba38f 100644 +--- a/src/settings/plugins/ifcfg-rh/reader.c ++++ b/src/settings/plugins/ifcfg-rh/reader.c +@@ -1041,6 +1041,13 @@ make_ip4_setting (shvarFile *ifcfg, + svCloseFile (network_ifcfg); + if (!read_success) + goto done; ++ ++ if (gateway && nm_setting_ip_config_get_num_addresses (s_ip4) == 0) { ++ gs_free char *f = g_path_get_basename (ifcfg->fileName); ++ PARSE_WARNING ("ignoring GATEWAY (/etc/sysconfig/network) for %s " ++ "because the connection has no static addresses", f); ++ g_clear_pointer (&gateway, g_free); ++ } + } + } + g_object_set (s_ip4, NM_SETTING_IP_CONFIG_GATEWAY, gateway, NULL); +diff --git a/src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am b/src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am +index 7b5aaf1..63c10a3 100644 +--- a/src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am ++++ b/src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am +@@ -14,6 +14,8 @@ EXTRA_DIST = \ + ifcfg-test-wired-dhcp6-only \ + ifcfg-test-wired-global-gateway \ + network-test-wired-global-gateway \ ++ ifcfg-test-wired-global-gateway-ignore \ ++ network-test-wired-global-gateway-ignore \ + ifcfg-test-wired-obsolete-gateway-n \ + ifcfg-test-wired-never-default \ + network-test-wired-never-default \ +diff --git a/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-global-gateway-ignore b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-global-gateway-ignore +new file mode 100644 +index 0000000..bb81399 +--- /dev/null ++++ b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-global-gateway-ignore +@@ -0,0 +1,8 @@ ++TYPE=Ethernet ++DEVICE=eth0 ++HWADDR=00:11:22:33:44:ee ++BOOTPROTO=dhcp ++ONBOOT=yes ++USERCTL=yes ++IPV6INIT=no ++ +diff --git a/src/settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-global-gateway-ignore b/src/settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-global-gateway-ignore +new file mode 100644 +index 0000000..7987d10 +--- /dev/null ++++ b/src/settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-global-gateway-ignore +@@ -0,0 +1 @@ ++GATEWAY=192.168.1.2 +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 953b0c7..f42dbf4 100644 +--- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c ++++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +@@ -868,6 +868,48 @@ test_read_wired_global_gateway (void) + g_object_unref (connection); + } + ++/* Ignore GATEWAY from /etc/sysconfig/network for automatic connections */ ++static void ++test_read_wired_global_gateway_ignore (void) ++{ ++ NMConnection *connection; ++ NMSettingConnection *s_con; ++ NMSettingWired *s_wired; ++ NMSettingIPConfig *s_ip4; ++ GError *error = NULL; ++ char *unmanaged = NULL; ++ ++ g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, ++ "*ignoring GATEWAY (/etc/sysconfig/network) for * because the connection has no static addresses"); ++ connection = connection_from_file_test (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-global-gateway-ignore", ++ TEST_IFCFG_DIR"/network-scripts/network-test-wired-global-gateway-ignore", ++ TYPE_ETHERNET, &unmanaged, &error); ++ nmtst_assert_connection_verifies_without_normalization (connection); ++ g_assert (unmanaged == NULL); ++ ++ /* ===== CONNECTION SETTING ===== */ ++ s_con = nm_connection_get_setting_connection (connection); ++ g_assert (s_con); ++ g_assert_cmpstr (nm_setting_connection_get_id (s_con), ==, "System test-wired-global-gateway-ignore"); ++ ++ /* ===== WIRED SETTING ===== */ ++ s_wired = nm_connection_get_setting_wired (connection); ++ g_assert (s_wired); ++ ++ /* ===== IPv4 SETTING ===== */ ++ s_ip4 = nm_connection_get_setting_ip4_config (connection); ++ g_assert (s_ip4); ++ g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_AUTO); ++ ++ /* Addresses */ ++ g_assert_cmpint (nm_setting_ip_config_get_num_addresses (s_ip4), ==, 0); ++ ++ /* Gateway */ ++ g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, NULL); ++ ++ g_object_unref (connection); ++} ++ + static void + test_read_wired_obsolete_gateway_n (void) + { +@@ -12608,6 +12650,7 @@ int main (int argc, char **argv) + g_test_add_func (TPATH "read-shared-plus-ip", test_read_wired_shared_plus_ip); + g_test_add_func (TPATH "read-dhcp-send-hostname", test_read_write_wired_dhcp_send_hostname); + g_test_add_func (TPATH "read-global-gateway", test_read_wired_global_gateway); ++ g_test_add_func (TPATH "read-global-gateway-ignore", test_read_wired_global_gateway_ignore); + g_test_add_func (TPATH "read-obsolete-gateway-n", test_read_wired_obsolete_gateway_n); + g_test_add_func (TPATH "read-never-default", test_read_wired_never_default); + test_read_wired_defroute_no (); +-- +2.1.0 + diff --git a/SOURCES/0013-rh1264089-nmcli-con-add-adsl.patch b/SOURCES/0013-rh1264089-nmcli-con-add-adsl.patch new file mode 100644 index 0000000..0d1c530 --- /dev/null +++ b/SOURCES/0013-rh1264089-nmcli-con-add-adsl.patch @@ -0,0 +1,446 @@ +From b46ed879198e911521373391c27982034699dfe5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= +Date: Tue, 10 Feb 2015 15:33:35 +0100 +Subject: [PATCH] nmcli: allow adding 'generic' connections via nmcli + connection add +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +'nmcli connection edit' already allows adding and editing generic connections +(added by 2a2af5825a6db62e7a88bb249cf7876551ed7fa3). + +(cherry picked from commit 0ff9b75387b7ac2fd0235b23699990834426c467) +Signed-off-by: Jiří Klimeš +--- + clients/cli/connections.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/clients/cli/connections.c b/clients/cli/connections.c +index 8d138bd..3c95c03 100644 +--- a/clients/cli/connections.c ++++ b/clients/cli/connections.c +@@ -4006,6 +4006,7 @@ complete_connection_by_type (NMConnection *connection, + GError **error) + { + NMSettingConnection *s_con; ++ NMSettingGeneric *s_generic; + NMSettingWired *s_wired; + NMSettingInfiniband *s_infiniband; + NMSettingWireless *s_wifi; +@@ -5232,6 +5233,10 @@ cleanup_olpc: + if (!success) + return FALSE; + ++ } else if (!strcmp (con_type, NM_SETTING_GENERIC_SETTING_NAME)) { ++ /* Add 'generic' setting */ ++ s_generic = (NMSettingGeneric *) nm_setting_generic_new (); ++ nm_connection_add_setting (connection, NM_SETTING (s_generic)); + } else { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: '%s' is not a valid connection type."), +-- +2.1.0 + + +From 1f7be4951900ca3004cb258225bc924f49deefd2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= +Date: Fri, 18 Sep 2015 10:42:10 +0200 +Subject: [PATCH 1/3] libnm-core/libnm-util: fix an assertion in adsl setting +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +(process:7799): GLib-CRITICAL **: g_ascii_strdown: assertion 'str != NULL' failed + +(cherry picked from commit 3d64d45d16d761802e92cc3d83a89e3dd572d36d) +Signed-off-by: Jiří Klimeš +--- + libnm-core/nm-setting-adsl.c | 7 +++++-- + libnm-util/nm-setting-adsl.c | 7 +++++-- + 2 files changed, 10 insertions(+), 4 deletions(-) + +diff --git a/libnm-core/nm-setting-adsl.c b/libnm-core/nm-setting-adsl.c +index 2e71f8e..7d78f06 100644 +--- a/libnm-core/nm-setting-adsl.c ++++ b/libnm-core/nm-setting-adsl.c +@@ -267,6 +267,7 @@ set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) + { + NMSettingAdslPrivate *priv = NM_SETTING_ADSL_GET_PRIVATE (object); ++ const char *str; + + switch (prop_id) { + case PROP_USERNAME: +@@ -282,11 +283,13 @@ set_property (GObject *object, guint prop_id, + break; + case PROP_PROTOCOL: + g_free (priv->protocol); +- priv->protocol = g_ascii_strdown (g_value_get_string (value), -1); ++ str = g_value_get_string (value); ++ priv->protocol = str ? g_ascii_strdown (str, -1) : NULL; + break; + case PROP_ENCAPSULATION: + g_free (priv->encapsulation); +- priv->encapsulation = g_ascii_strdown (g_value_get_string (value), -1); ++ str = g_value_get_string (value); ++ priv->encapsulation = str ? g_ascii_strdown (str, -1) : NULL; + break; + case PROP_VPI: + priv->vpi = g_value_get_uint (value); +diff --git a/libnm-util/nm-setting-adsl.c b/libnm-util/nm-setting-adsl.c +index 5355011..51560a7 100644 +--- a/libnm-util/nm-setting-adsl.c ++++ b/libnm-util/nm-setting-adsl.c +@@ -287,6 +287,7 @@ set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) + { + NMSettingAdslPrivate *priv = NM_SETTING_ADSL_GET_PRIVATE (object); ++ const char *str; + + switch (prop_id) { + case PROP_USERNAME: +@@ -302,11 +303,13 @@ set_property (GObject *object, guint prop_id, + break; + case PROP_PROTOCOL: + g_free (priv->protocol); +- priv->protocol = g_ascii_strdown (g_value_get_string (value), -1); ++ str = g_value_get_string (value); ++ priv->protocol = str ? g_ascii_strdown (str, -1) : NULL; + break; + case PROP_ENCAPSULATION: + g_free (priv->encapsulation); +- priv->encapsulation = g_ascii_strdown (g_value_get_string (value), -1); ++ str = g_value_get_string (value); ++ priv->encapsulation = str ? g_ascii_strdown (str, -1) : NULL; + break; + case PROP_VPI: + priv->vpi = g_value_get_uint (value); +-- +2.1.0 + + +From 9bca3b7a37f00b94e3feec0ab400cfa5dfe60831 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= +Date: Fri, 18 Sep 2015 11:08:28 +0200 +Subject: [PATCH 2/3] cli: initialize adsl.protocol in editor when creating a + new connection +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The protocol is required and it is nice to have a valid initial value for +the property. + +(cherry picked from commit 5502d8691a0e1b7174a0be85951f155fa587e400) +Signed-off-by: Jiří Klimeš +--- + clients/cli/connections.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/clients/cli/connections.c b/clients/cli/connections.c +index 3c95c03..e8391ea 100644 +--- a/clients/cli/connections.c ++++ b/clients/cli/connections.c +@@ -8378,6 +8378,14 @@ editor_init_new_connection (NmCli *nmc, NMConnection *connection) + nmc_setting_custom_init (base_setting); + } + ++ /* ADSL */ ++ if (g_strcmp0 (con_type, NM_SETTING_ADSL_SETTING_NAME) == 0) { ++ /* Initialize a protocol */ ++ g_object_set (NM_SETTING_ADSL (base_setting), ++ NM_SETTING_ADSL_PROTOCOL, NM_SETTING_ADSL_PROTOCOL_PPPOE, ++ NULL); ++ } ++ + /* Always add IPv4 and IPv6 settings for non-slave connections */ + setting = nm_setting_ip4_config_new (); + nmc_setting_custom_init (setting); +-- +2.1.0 + + +From b590a318398decb31c9b21f481dbc7e28e0ecc8e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= +Date: Fri, 18 Sep 2015 12:05:49 +0200 +Subject: [PATCH 3/3] cli: allow creating ADSL connections with 'nmcli + connection add' (rh #1264089) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +https://bugzilla.redhat.com/show_bug.cgi?id=1264089 + +(cherry picked from commit 290c1626b9788aa90861ca423c0dffb59fe29876) +Signed-off-by: Jiří Klimeš +--- + clients/cli/connections.c | 141 +++++++++++++++++++++++++++++++++++++++++++ + clients/cli/nmcli-completion | 19 +++++- + man/nmcli.1.in | 12 ++++ + 3 files changed, 171 insertions(+), 1 deletion(-) + +diff --git a/clients/cli/connections.c b/clients/cli/connections.c +index e8391ea..b6614ae 100644 +--- a/clients/cli/connections.c ++++ b/clients/cli/connections.c +@@ -397,6 +397,10 @@ usage_connection_add (void) + " olpc-mesh: ssid \n" + " [channel <1-13>]\n" + " [dhcp-anycast ]\n\n" ++ " adsl: username \n" ++ " protocol pppoa|pppoe|ipoatm\n" ++ " [password ]\n" ++ " [encapsulation vcmux|llc]\n\n" + " IP_OPTIONS:\n" + " [ip4 ] [gw4 ]\n" + " [ip6 ] [gw6 ]\n\n")); +@@ -2904,6 +2908,29 @@ check_infiniband_mode (char **mode, GError **error) + return check_valid_enumeration (mode, modes, "mode", _("InfiniBand transport mode"), error); + } + ++/* Checks ADSL protocol */ ++static gboolean ++check_adsl_protocol (char **protocol, GError **error) ++{ ++ const char *protos[] = { NM_SETTING_ADSL_PROTOCOL_PPPOA, ++ NM_SETTING_ADSL_PROTOCOL_PPPOE, ++ NM_SETTING_ADSL_PROTOCOL_IPOATM, ++ NULL }; ++ ++ return check_valid_enumeration (protocol, protos, "protocol", _("ADSL protocol"), error); ++} ++ ++/* Checks ADSL encapsulation */ ++static gboolean ++check_adsl_encapsulation (char **encapsulation, GError **error) ++{ ++ const char *modes[] = { NM_SETTING_ADSL_ENCAPSULATION_VCMUX, ++ NM_SETTING_ADSL_ENCAPSULATION_LLC, ++ NULL }; ++ ++ return check_valid_enumeration (encapsulation, modes, "encapsulation", _("ADSL encapsulation"), error); ++} ++ + static gboolean + check_and_convert_vlan_flags (const char *flags, guint32 *flags_int, GError **error) + { +@@ -3871,6 +3898,33 @@ do_questionnaire_olpc (char **channel, char **dhcp_anycast) + } + } + ++#define PROMPT_ADSL_ENCAP "(" NM_SETTING_ADSL_ENCAPSULATION_VCMUX "/" NM_SETTING_ADSL_ENCAPSULATION_LLC ") [none]: " ++static void ++do_questionnaire_adsl (char **password, char **encapsulation) ++{ ++ gboolean once_more; ++ GError *error = NULL; ++ ++ /* Ask for optional 'adsl' arguments. */ ++ if (!want_provide_opt_args (_("ADSL"), 2)) ++ return; ++ ++ if (!*password) ++ *password = nmc_readline (_("Password [none]: ")); ++ ++ if (!*encapsulation) { ++ do { ++ *encapsulation = nmc_readline (_("ADSL encapsulation %s"), PROMPT_ADSL_ENCAP); ++ once_more = !check_adsl_encapsulation (encapsulation, &error); ++ if (once_more) { ++ g_print ("%s\n", error->message); ++ g_clear_error (&error); ++ g_free (*encapsulation); ++ } ++ } while (once_more); ++ } ++} ++ + static gboolean + split_address (char* str, char **ip, char **rest) + { +@@ -4023,6 +4077,7 @@ complete_connection_by_type (NMConnection *connection, + NMSettingBridgePort *s_bridge_port; + NMSettingVpn *s_vpn; + NMSettingOlpcMesh *s_olpc_mesh; ++ NMSettingAdsl *s_adsl; + + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + +@@ -5233,6 +5288,74 @@ cleanup_olpc: + if (!success) + return FALSE; + ++ } else if (!strcmp (con_type, NM_SETTING_ADSL_SETTING_NAME)) { ++ /* Build up the settings required for 'adsl' */ ++ gboolean success = FALSE; ++ char *username_ask = NULL; ++ const char *username = NULL; ++ char *protocol_ask = NULL; ++ const char *protocol = NULL; ++ const char *password_c = NULL; ++ char *password = NULL; ++ const char *encapsulation_c = NULL; ++ char *encapsulation = NULL; ++ nmc_arg_t exp_args[] = { {"username", TRUE, &username, !ask}, ++ {"protocol", TRUE, &protocol, !ask}, ++ {"password", TRUE, &password_c, FALSE}, ++ {"encapsulation", TRUE, &encapsulation_c, FALSE}, ++ {NULL} }; ++ ++ if (!nmc_parse_args (exp_args, FALSE, &argc, &argv, error)) ++ return FALSE; ++ ++ if (!username && ask) ++ username = username_ask = nmc_readline (_("Username: ")); ++ if (!username) { ++ g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, ++ _("Error: 'username' is required.")); ++ goto cleanup_adsl; ++ } ++ ++#define PROMPT_ADSL_PROTO "(" NM_SETTING_ADSL_PROTOCOL_PPPOA "/" NM_SETTING_ADSL_PROTOCOL_PPPOE "/" NM_SETTING_ADSL_PROTOCOL_IPOATM "): " ++ if (!protocol && ask) ++ protocol = protocol_ask = nmc_readline (_("Protocol %s"), PROMPT_ADSL_PROTO); ++ if (!protocol) { ++ g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, ++ _("Error: 'protocol' is required.")); ++ goto cleanup_adsl; ++ } ++ if (!check_adsl_protocol (&protocol_ask, error)) ++ goto cleanup_adsl; ++ ++ /* Also ask for all optional arguments if '--ask' is specified. */ ++ password = g_strdup (password_c); ++ encapsulation = g_strdup (encapsulation_c); ++ if (ask) ++ do_questionnaire_adsl (&password, &encapsulation); ++ ++ if (!check_adsl_encapsulation (&encapsulation, error)) ++ goto cleanup_adsl; ++ ++ /* Add ADSL setting */ ++ s_adsl = (NMSettingAdsl *) nm_setting_adsl_new (); ++ nm_connection_add_setting (connection, NM_SETTING (s_adsl)); ++ ++ g_object_set (s_adsl, ++ NM_SETTING_ADSL_USERNAME, username, ++ NM_SETTING_ADSL_PROTOCOL, protocol, ++ NM_SETTING_ADSL_PASSWORD, password, ++ NM_SETTING_ADSL_ENCAPSULATION, encapsulation, ++ NULL); ++ ++ success = TRUE; ++cleanup_adsl: ++ g_free (username_ask); ++ g_free (password); ++ g_free (protocol_ask); ++ g_free (encapsulation); ++ if (!success) ++ return FALSE; ++ + } else if (!strcmp (con_type, NM_SETTING_GENERIC_SETTING_NAME)) { + /* Add 'generic' setting */ + s_generic = (NMSettingGeneric *) nm_setting_generic_new (); +@@ -5470,6 +5593,20 @@ gen_func_bond_mon_mode (const char *text, int state) + } + + static char * ++gen_func_adsl_proto (const char *text, int state) ++{ ++ const char *words[] = { "pppoe", "pppoa", "ipoatm", NULL }; ++ return nmc_rl_gen_func_basic (text, state, words); ++} ++ ++static char * ++gen_func_adsl_encap (const char *text, int state) ++{ ++ const char *words[] = { "vcmux", "llc", NULL }; ++ return nmc_rl_gen_func_basic (text, state, words); ++} ++ ++static char * + gen_func_master_ifnames (const char *text, int state) + { + int i; +@@ -5557,6 +5694,10 @@ nmcli_con_add_tab_completion (const char *text, int start, int end) + generator_func = gen_func_bond_mode; + else if (g_str_has_suffix (rl_prompt, PROMPT_BOND_MON_MODE)) + generator_func = gen_func_bond_mon_mode; ++ else if (g_str_has_suffix (rl_prompt, PROMPT_ADSL_PROTO)) ++ generator_func = gen_func_adsl_proto; ++ else if (g_str_has_suffix (rl_prompt, PROMPT_ADSL_ENCAP)) ++ generator_func = gen_func_adsl_encap; + + if (generator_func) + match_array = rl_completion_matches (text, generator_func); +diff --git a/clients/cli/nmcli-completion b/clients/cli/nmcli-completion +index 4146eae..9f34b83 100644 +--- a/clients/cli/nmcli-completion ++++ b/clients/cli/nmcli-completion +@@ -353,7 +353,7 @@ _nmcli_compl_ARGS() + # user friendly. Only complete them, if the current word already starts with an "8". + _nmcli_list "802-3-ethernet 802-11-wireless 802-11-olpc-mesh" + else +- _nmcli_list "ethernet wifi wimax gsm cdma infiniband bluetooth vpn olpc-mesh vlan bond bond-slave bridge bridge-slave team team-slave pppoe" ++ _nmcli_list "ethernet wifi wimax gsm cdma infiniband bluetooth vpn olpc-mesh vlan bond bond-slave bridge bridge-slave team team-slave pppoe adsl" + fi + return 0 + fi +@@ -522,6 +522,18 @@ _nmcli_compl_ARGS() + return 0 + fi + ;; ++ encapsulation) ++ if [[ "${#words[@]}" -eq 2 ]]; then ++ _nmcli_list "vcmux llc" ++ return 0 ++ fi ++ ;; ++ protocol) ++ if [[ "${#words[@]}" -eq 2 ]]; then ++ _nmcli_list "pppoa pppoe ipoatm" ++ return 0 ++ fi ++ ;; + *) + return 1 + ;; +@@ -1010,6 +1022,11 @@ _nmcli() + OPTIONS_TYPED=(username password service mtu mac) + OPTIONS_MANDATORY=(username) + ;; ++ a|ad|ads|adsl) ++ OPTIONS_TYPE=adsl ++ OPTIONS_TYPED=(username password protocol encapsulation) ++ OPTIONS_MANDATORY=(username protocol) ++ ;; + *) + # for an unknown connection type, we stop completion here + return 0 +diff --git a/man/nmcli.1.in b/man/nmcli.1.in +index 6df844d..a680901 100644 +--- a/man/nmcli.1.in ++++ b/man/nmcli.1.in +@@ -619,6 +619,18 @@ to be sent back out through the slave the frame was received on (default: yes) + .RE + .RS + .TP ++.B adsl: ++.IP "\fIusername \fP" 42 ++\(en ADSL user name ++.IP "\fIprotocol pppoa|pppoe|ipoatm\fP" 42 ++\(en ADSL protocol ++.IP "\fI[password ]\fP" 42 ++\(en ADSL password ++.IP "\fI[encapsulation vcmux|llc]\fP" 42 ++\(en ADSL encapsulation ++.RE ++.RS ++.TP + .B IP_OPTIONS: + .IP "\fI[ip4 ] [gw4 ]\fP" 42 + \(en IPv4 addresses +-- +2.1.0 + diff --git a/SOURCES/0014-rh-1260727-crash-in-internal-dhcp-client.patch b/SOURCES/0014-rh-1260727-crash-in-internal-dhcp-client.patch new file mode 100644 index 0000000..64d9abf --- /dev/null +++ b/SOURCES/0014-rh-1260727-crash-in-internal-dhcp-client.patch @@ -0,0 +1,402 @@ +From 0ec47c9b81a6fb6be44ccc852fbc7def22056ef2 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Wed, 23 Sep 2015 16:03:41 +0200 +Subject: [PATCH 1/7] logging: coerce negative error values to positive errno + +Especially systemd, which makes use of the error argument for logging, likes +to represent errors as negative numbers. We hence must invert a negative error +code to get the real errno. + +(cherry picked from commit d6370d09e6aa158d4fc7fe1e2ce4c335eed1e017) +(cherry picked from commit 972865bc4ef67557f04fba6b7a92edb70c9d3927) +--- + src/nm-logging.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/nm-logging.c b/src/nm-logging.c +index fa77034..b8433a2 100644 +--- a/src/nm-logging.c ++++ b/src/nm-logging.c +@@ -381,8 +381,11 @@ _nm_log_impl (const char *file, + return; + + /* Make sure that %m maps to the specified error */ +- if (error != 0) ++ if (error != 0) { ++ if (error < 0) ++ error = -error; + errno = error; ++ } + + va_start (args, fmt); + msg = g_strdup_vprintf (fmt, args); +-- +2.4.3 + + +From 0c2078244f101653738460a9d6dd4983d30e08fe Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Tue, 22 Sep 2015 12:34:37 +0200 +Subject: [PATCH 2/7] systemd/adapt: refactor creation of struct + sd_event_source + +(cherry picked from commit 41917a52c085b8699e5b37ef9b574ee265dcd0bf) +(cherry picked from commit 436ed50f4ab5ff152fe946f9ffdf3f2f822d0469) +--- + src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c b/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c +index a6d8172..7984dcb 100644 +--- a/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c ++++ b/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c +@@ -37,6 +37,16 @@ struct sd_event_source { + sd_event_time_handler_t time_cb; + }; + ++static struct sd_event_source * ++source_new (void) ++{ ++ struct sd_event_source *source; ++ ++ source = g_new0 (struct sd_event_source, 1); ++ source->refcount = 1; ++ return source; ++} ++ + int + sd_event_source_set_priority (sd_event_source *s, int64_t priority) + { +@@ -113,8 +123,7 @@ sd_event_add_io (sd_event *e, sd_event_source **s, int fd, uint32_t events, sd_e + if (!channel) + return -EINVAL; + +- source = g_new0 (struct sd_event_source, 1); +- source->refcount = 1; ++ source = source_new (); + source->io_cb = callback; + source->user_data = userdata; + source->channel = channel; +@@ -158,8 +167,7 @@ sd_event_add_time(sd_event *e, sd_event_source **s, clockid_t clock, uint64_t us + struct sd_event_source *source; + uint64_t n = now (clock); + +- source = g_new0 (struct sd_event_source, 1); +- source->refcount = 1; ++ source = source_new (); + source->time_cb = callback; + source->user_data = userdata; + source->usec = usec; +-- +2.4.3 + + +From f154c9ccef5d20a2aa765e84d9403e66510e9e2f Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Tue, 22 Sep 2015 12:35:42 +0200 +Subject: [PATCH 3/7] systemd/adapt: use slice-allocator for struct + sd_event_source + +(cherry picked from commit fb0e87be394c0fdb4ccf2911bd089bbdf0b19113) +(cherry picked from commit 8c08014f475c4a60e129d4cd755ff30db5eac4bc) +--- + src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c b/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c +index 7984dcb..1f6038e 100644 +--- a/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c ++++ b/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c +@@ -42,7 +42,7 @@ source_new (void) + { + struct sd_event_source *source; + +- source = g_new0 (struct sd_event_source, 1); ++ source = g_slice_new0 (struct sd_event_source); + source->refcount = 1; + return source; + } +@@ -72,7 +72,7 @@ sd_event_source_unref (sd_event_source *s) + */ + g_io_channel_unref (s->channel); + } +- g_free (s); ++ g_slice_free (struct sd_event_source, s); + } + return NULL; + } +-- +2.4.3 + + +From 5d35919178a5a8df7804247da976352244e89cab Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Tue, 22 Sep 2015 12:44:14 +0200 +Subject: [PATCH 4/7] systemd/adapt: fix potential crash invoking + sd_event_source callbacks + +It is common that the callbacks unref the event source. Hence we must +ensure that the @source stays alive until the callback returns. + +(cherry picked from commit 9901047ae3464999ab5c52ac408f603c73239597) +(cherry picked from commit 55e46923c073fc5a38fcf572da05d55c0fc0b71f) +--- + src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c | 28 ++++++++++++++++++++-------- + 1 file changed, 20 insertions(+), 8 deletions(-) + +diff --git a/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c b/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c +index 1f6038e..67ddc8d 100644 +--- a/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c ++++ b/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c +@@ -91,6 +91,7 @@ static gboolean + io_ready (GIOChannel *channel, GIOCondition condition, struct sd_event_source *source) + { + int r, revents = 0; ++ gboolean result; + + if (condition & G_IO_IN) + revents |= EPOLLIN; +@@ -103,13 +104,18 @@ io_ready (GIOChannel *channel, GIOCondition condition, struct sd_event_source *s + if (condition & G_IO_HUP) + revents |= EPOLLHUP; + ++ source->refcount++; ++ + r = source->io_cb (source, g_io_channel_unix_get_fd (channel), revents, source->user_data); +- if (r < 0) { ++ if (r < 0 || source->refcount <= 1) { + source->id = 0; +- return G_SOURCE_REMOVE; +- } ++ result = G_SOURCE_REMOVE; ++ } else ++ result = G_SOURCE_CONTINUE; ++ ++ sd_event_source_unref (source); + +- return G_SOURCE_CONTINUE; ++ return result; + } + + int +@@ -151,14 +157,20 @@ static gboolean + time_ready (struct sd_event_source *source) + { + int r; ++ gboolean result; ++ ++ source->refcount++; + + r = source->time_cb (source, source->usec, source->user_data); +- if (r < 0) { ++ if (r < 0 || source->refcount <= 1) { + source->id = 0; +- return G_SOURCE_REMOVE; +- } ++ result = G_SOURCE_REMOVE; ++ } else ++ result = G_SOURCE_CONTINUE; ++ ++ sd_event_source_unref (source); + +- return G_SOURCE_CONTINUE; ++ return result; + } + + int +-- +2.4.3 + + +From bfd1b1daaaed47a7c91c4561c7de29091cdf702d Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Tue, 22 Sep 2015 13:26:58 +0200 +Subject: [PATCH 5/7] systemd/adapt: assert that a @source argument is passed + to sd_event_add_time() + +Systemd supports omitting the output source argument. In this case, +the created event source is floating and the reference count +is handled properly. + +We have however no callers that make use of that functionality, so +instead of implementing floating references, assert that we don't +need it. + +This isn't a change in behavior, because previously the could would just +SEGFAULT if a caller didn't want to take ownership of the created event. + +(cherry picked from commit 02c51d4231da154b624fe5859a1e34f340eecb05) +(cherry picked from commit 11237a0a66df5e2486d961050aa03103578c40d2) +--- + src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c b/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c +index 67ddc8d..1f8f2dc 100644 +--- a/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c ++++ b/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c +@@ -125,6 +125,10 @@ sd_event_add_io (sd_event *e, sd_event_source **s, int fd, uint32_t events, sd_e + GIOChannel *channel; + GIOCondition condition = 0; + ++ /* systemd supports floating sd_event_source by omitting the @s argument. ++ * We don't have such users and don't implement floating references. */ ++ g_return_val_if_fail (s, -EINVAL); ++ + channel = g_io_channel_unix_new (fd); + if (!channel) + return -EINVAL; +@@ -179,6 +183,10 @@ sd_event_add_time(sd_event *e, sd_event_source **s, clockid_t clock, uint64_t us + struct sd_event_source *source; + uint64_t n = now (clock); + ++ /* systemd supports floating sd_event_source by omitting the @s argument. ++ * We don't have such users and don't implement floating references. */ ++ g_return_val_if_fail (s, -EINVAL); ++ + source = source_new (); + source->time_cb = callback; + source->user_data = userdata; +-- +2.4.3 + + +From 04d5235aa7e7cff5ec6e62e73a8a8d47bd478ab7 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Wed, 23 Sep 2015 09:48:00 +0200 +Subject: [PATCH 6/7] systemd/adapt: refactor sd_event_source to use a union + for holding mutually exclusive fields + +sd_event_source is either used for sd_event_add_io() or sd_event_add_time(). +Depending on the use, different fields of the struct are relevant. Refactor +the struct to have a union. + +This reduces the size of the struct, but more importantly, it makes it +clear which fields are used in which context. + +(cherry picked from commit 2d2d742cf1787a948a20bf7a12acd17fa62e1dc9) +(cherry picked from commit 0e6a13bccc6503657781f91960b82212af7317f8) +--- + src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c | 22 ++++++++++++++-------- + 1 file changed, 14 insertions(+), 8 deletions(-) + +diff --git a/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c b/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c +index 1f8f2dc..24b77c5 100644 +--- a/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c ++++ b/src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c +@@ -31,10 +31,16 @@ struct sd_event_source { + gpointer user_data; + + GIOChannel *channel; +- sd_event_io_handler_t io_cb; + +- uint64_t usec; +- sd_event_time_handler_t time_cb; ++ union { ++ struct { ++ sd_event_io_handler_t cb; ++ } io; ++ struct { ++ sd_event_time_handler_t cb; ++ uint64_t usec; ++ } time; ++ }; + }; + + static struct sd_event_source * +@@ -106,7 +112,7 @@ io_ready (GIOChannel *channel, GIOCondition condition, struct sd_event_source *s + + source->refcount++; + +- r = source->io_cb (source, g_io_channel_unix_get_fd (channel), revents, source->user_data); ++ r = source->io.cb (source, g_io_channel_unix_get_fd (channel), revents, source->user_data); + if (r < 0 || source->refcount <= 1) { + source->id = 0; + result = G_SOURCE_REMOVE; +@@ -134,7 +140,7 @@ sd_event_add_io (sd_event *e, sd_event_source **s, int fd, uint32_t events, sd_e + return -EINVAL; + + source = source_new (); +- source->io_cb = callback; ++ source->io.cb = callback; + source->user_data = userdata; + source->channel = channel; + +@@ -165,7 +171,7 @@ time_ready (struct sd_event_source *source) + + source->refcount++; + +- r = source->time_cb (source, source->usec, source->user_data); ++ r = source->time.cb (source, source->time.usec, source->user_data); + if (r < 0 || source->refcount <= 1) { + source->id = 0; + result = G_SOURCE_REMOVE; +@@ -188,9 +194,9 @@ sd_event_add_time(sd_event *e, sd_event_source **s, clockid_t clock, uint64_t us + g_return_val_if_fail (s, -EINVAL); + + source = source_new (); +- source->time_cb = callback; ++ source->time.cb = callback; + source->user_data = userdata; +- source->usec = usec; ++ source->time.usec = usec; + + if (usec > 1000) + usec = n < usec - 1000 ? usec - n : 1000; +-- +2.4.3 + + +From 5980ff8b1106f2adb55a9ce6665e76d85d70734d Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Tue, 22 Sep 2015 14:03:32 +0200 +Subject: [PATCH 7/7] systemd: avoid potential crash due to uncanceled timers + in client_receive_advertise() + +Got a crash with unknown reason on nm-1-0 branch. It's unclear why, +but the reason could be that a lease in client_receive_advertise() +was cleared, but not its timers. + +Backtrace from nm-1-0 branch (note that the systemd code where the crash +happend is different, but similar): + + #0 sd_event_source_unref (s=0xf5c007e8fb894853) at dhcp-manager/systemd-dhcp/nm-sd-adapt.c:53 + #1 0x0000555555682340 in client_timeout_t1 (s=, usec=, userdata=0x5555559f5240) + at dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c:451 + #2 0x00005555556a078f in time_ready (source=0x5555559f3c20) at dhcp-manager/systemd-dhcp/nm-sd-adapt.c:146 + #3 0x00007ffff4a481b3 in g_timeout_dispatch () from /lib64/libglib-2.0.so.0 + #4 0x00007ffff4a4779a in g_main_context_dispatch () from /lib64/libglib-2.0.so.0 + #5 0x00007ffff4a47ae8 in g_main_context_iterate.isra.24 () from /lib64/libglib-2.0.so.0 + #6 0x00007ffff4a47dba in g_main_loop_run () from /lib64/libglib-2.0.so.0 + #7 0x0000555555597073 in main (argc=1, argv=0x7fffffffe2b8) at main.c:512 + +Equivalent upstream systemd patch: + https://github.com/systemd/systemd/pull/1332 + https://github.com/systemd/systemd/commit/f89087272b5561c9a3fc9d6a4e2a09f75f688fa7 + +https://bugzilla.redhat.com/show_bug.cgi?id=1260727 +(cherry picked from commit 401a2eb834bdddd8931161eb86204eb80d26b2c7) +(cherry picked from commit fe70a87f942fa4a5d509787852185a7168739de6) +--- + .../systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c +index 6c5a6ab..8a17a72 100644 +--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c ++++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c +@@ -828,7 +828,10 @@ static int client_receive_advertise(sd_dhcp6_client *client, + + r = dhcp6_lease_get_preference(client->lease, &pref_lease); + if (!client->lease || r < 0 || pref_advertise > pref_lease) { +- sd_dhcp6_lease_unref(client->lease); ++ if (client->lease) { ++ dhcp6_lease_clear_timers(&client->lease->ia); ++ sd_dhcp6_lease_unref(client->lease); ++ } + client->lease = lease; + lease = NULL; + r = 0; +-- +2.4.3 + diff --git a/SOURCES/0015-rh1264024-platform-perm-addr.patch b/SOURCES/0015-rh1264024-platform-perm-addr.patch new file mode 100644 index 0000000..c01fca9 --- /dev/null +++ b/SOURCES/0015-rh1264024-platform-perm-addr.patch @@ -0,0 +1,97 @@ +From 09fc004d3ca14f16219ac42bc87a6b8e3050dbef Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Thu, 17 Sep 2015 18:48:45 +0200 +Subject: [PATCH 1/2] platform: stack-allocate request data for + nmp_utils_ethtool_get_permanent_address() + +(cherry picked from commit 2e66aea123fb6d504ab0e447d1b7bff0ba0a785b) +(cherry picked from commit 6839a5f9e32dc1f7c52c51a18751242baad3659b) +--- + src/platform/nm-platform-utils.c | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +diff --git a/src/platform/nm-platform-utils.c b/src/platform/nm-platform-utils.c +index b7f0947..795e23a 100644 +--- a/src/platform/nm-platform-utils.c ++++ b/src/platform/nm-platform-utils.c +@@ -139,21 +139,24 @@ nmp_utils_ethtool_get_permanent_address (const char *ifname, + guint8 *buf, + size_t *length) + { +- gs_free struct ethtool_perm_addr *epaddr = NULL; ++ struct { ++ struct ethtool_perm_addr e; ++ guint8 _extra_data[NM_UTILS_HWADDR_LEN_MAX + 1]; ++ } edata; + + if (!ifname) + return FALSE; + +- epaddr = g_malloc0 (sizeof (*epaddr) + NM_UTILS_HWADDR_LEN_MAX); +- epaddr->cmd = ETHTOOL_GPERMADDR; +- epaddr->size = NM_UTILS_HWADDR_LEN_MAX; ++ memset (&edata, 0, sizeof (edata)); ++ edata.e.cmd = ETHTOOL_GPERMADDR; ++ edata.e.size = NM_UTILS_HWADDR_LEN_MAX; + +- if (!ethtool_get (ifname, epaddr)) ++ if (!ethtool_get (ifname, &edata.e)) + return FALSE; + +- g_assert (epaddr->size <= NM_UTILS_HWADDR_LEN_MAX); +- memcpy (buf, epaddr->data, epaddr->size); +- *length = epaddr->size; ++ g_assert (edata.e.size <= NM_UTILS_HWADDR_LEN_MAX); ++ memcpy (buf, edata.e.data, edata.e.size); ++ *length = edata.e.size; + return TRUE; + } + +-- +2.4.3 + + +From 9097a488c8a72ac6a935a452dd9db3df9c28232c Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Thu, 17 Sep 2015 19:53:56 +0200 +Subject: [PATCH 2/2] platform: don't accept 00:00:00:00:00:00 as valid + permanent address + +In nmp_utils_ethtool_get_permanent_address(), don' accept a permanent +address of all zeros. + +https://bugzilla.redhat.com/show_bug.cgi?id=1264024 +(cherry picked from commit 2733aacd6495f2bdba81ddda617c9a506abd9e73) +(cherry picked from commit 0f18a2ed23f9b6a966738d56556c15cdd6e9e44c) +--- + src/platform/nm-platform-utils.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/src/platform/nm-platform-utils.c b/src/platform/nm-platform-utils.c +index 795e23a..051a873 100644 +--- a/src/platform/nm-platform-utils.c ++++ b/src/platform/nm-platform-utils.c +@@ -143,6 +143,7 @@ nmp_utils_ethtool_get_permanent_address (const char *ifname, + struct ethtool_perm_addr e; + guint8 _extra_data[NM_UTILS_HWADDR_LEN_MAX + 1]; + } edata; ++ guint zeros[NM_UTILS_HWADDR_LEN_MAX] = { 0 }; + + if (!ifname) + return FALSE; +@@ -155,6 +156,12 @@ nmp_utils_ethtool_get_permanent_address (const char *ifname, + return FALSE; + + g_assert (edata.e.size <= NM_UTILS_HWADDR_LEN_MAX); ++ ++ /* Some drivers might return a permanent address of all zeros. ++ * Reject that (rh#1264024) */ ++ if (memcmp (edata.e.data, zeros, edata.e.size) == 0) ++ return FALSE; ++ + memcpy (buf, edata.e.data, edata.e.size); + *length = edata.e.size; + return TRUE; +-- +2.4.3 + diff --git a/SOURCES/0016-rh1101809-increase-dad-timeout.patch b/SOURCES/0016-rh1101809-increase-dad-timeout.patch new file mode 100644 index 0000000..a70daaa --- /dev/null +++ b/SOURCES/0016-rh1101809-increase-dad-timeout.patch @@ -0,0 +1,39 @@ +From 3379fa4525438a8e569ed0777a8503a34816e9fe Mon Sep 17 00:00:00 2001 +From: Dan Williams +Date: Thu, 17 Sep 2015 09:55:23 -0500 +Subject: [PATCH] device: increase IPv6LL DAD timeout (rh #1101809) + +Depending on the network and the values of the 'dad_transmits' and +'retrans_timeout_ms' sysctls, DAD for the IPv6LL address can take +quite a while. Obviously there must be some upper bound on the +timeout, but 5 seconds seems a bit low. In this case it was observed +to be ~12 seconds but the sysctl values are unknown. In any case, +we can't predict the network/config so being a bit more lenient here +makes sense. + +https://bugzilla.redhat.com/show_bug.cgi?id=1101809 +--- + src/devices/nm-device.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index 22a235d..51cb4e6 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -4694,7 +4694,12 @@ linklocal6_start (NMDevice *self) + + check_and_add_ipv6ll_addr (self); + +- priv->linklocal6_timeout_id = g_timeout_add_seconds (5, linklocal6_timeout_cb, self); ++ /* Depending on the network and what the 'dad_transmits' and 'retrans_time_ms' ++ * sysctl values are, DAD for the IPv6LL address may take quite a while. ++ * FIXME: use dad/retrans sysctl values if they are higher than a minimum time. ++ * (rh #1101809) ++ */ ++ priv->linklocal6_timeout_id = g_timeout_add_seconds (15, linklocal6_timeout_cb, self); + + return NM_ACT_STAGE_RETURN_POSTPONE; + } +-- +2.1.0 + diff --git a/SOURCES/0017-rh1267004-vpn-mtu-for-ip-interface.patch b/SOURCES/0017-rh1267004-vpn-mtu-for-ip-interface.patch new file mode 100644 index 0000000..8cf3c94 --- /dev/null +++ b/SOURCES/0017-rh1267004-vpn-mtu-for-ip-interface.patch @@ -0,0 +1,56 @@ +From 105e30efbaf422401902575749efdcd18706ace1 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Mon, 28 Sep 2015 20:57:09 +0200 +Subject: [PATCH] vpn-connection: set the MTU for the VPN IP interface + +The 9b79e6c73 commit moved setting of the MTU from IP4Config to NMDevice, but +VPN connections don't have a NMDevice instance (yet). Set the MTU also from the +VPN connection. Also, copying of the MTU to the IP4Config is no longer needed +as the ip4_config_commit no longer sets the MTU. + +Fixes: 9b79e6c732ffb2fb105647c1465070d36a6cc180 + +https://bugzilla.gnome.org/show_bug.cgi?id=754781 +(cherry picked from commit e0fa48f224abcb73a1a129f10050f7cd942ee629) +--- + src/vpn-manager/nm-vpn-connection.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c +index f0e6149..e2d3103 100644 +--- a/src/vpn-manager/nm-vpn-connection.c ++++ b/src/vpn-manager/nm-vpn-connection.c +@@ -980,6 +980,9 @@ nm_vpn_connection_apply_config (NMVpnConnection *connection) + TRUE)) + return FALSE; + } ++ ++ if (priv->mtu && priv->mtu != nm_platform_link_get_mtu (NM_PLATFORM_GET, priv->ip_ifindex)) ++ nm_platform_link_set_mtu (NM_PLATFORM_GET, priv->ip_ifindex, priv->mtu); + } + + apply_parent_device_config (connection); +@@ -1149,10 +1152,6 @@ process_generic_config (NMVpnConnection *connection, + } + } + +- /* MTU; this is a per-connection value, though NM's API treats it +- * like it's IP4-specific. So we store it for now and retrieve it +- * later in ip4_config_get. +- */ + priv->mtu = 0; + val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_CONFIG_MTU); + if (val) { +@@ -1328,9 +1327,6 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy, + if (val) + nm_ip4_config_set_mss (config, g_value_get_uint (val)); + +- if (priv->mtu) +- nm_ip4_config_set_mtu (config, priv->mtu, NM_IP_CONFIG_SOURCE_VPN); +- + val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_DOMAIN); + if (val) + nm_ip4_config_add_domain (config, g_value_get_string (val)); +-- +2.4.3 + diff --git a/SOURCES/0018-rh1263959-modem-ip-families.patch b/SOURCES/0018-rh1263959-modem-ip-families.patch new file mode 100644 index 0000000..fc4f758 --- /dev/null +++ b/SOURCES/0018-rh1263959-modem-ip-families.patch @@ -0,0 +1,60 @@ +From eecb4c46cc35c43c12e84e530b3be50374baa792 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= +Date: Tue, 22 Sep 2015 18:42:40 +0200 +Subject: [PATCH] modem-broadband: update modem's supported-ip-families (rh + #1263959) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If SIM in a modem is locked, ModemManager can't initialize SupportedIpFamilies +and NetworkManager will set the property to 0. ModemManager then updates the +property after the modem is unlocked, but NetworkManager did not watch changes +to the property. And that resulted in a connection failure: +(ttyUSB1): Failed to connect 'O2 Internet': Connection requested IPv4 but IPv4 is unsuported by the modem. +(ttyUSB1): device state change: prepare -> failed (reason 'modem-init-failed') [40 120 28] + +https://bugzilla.redhat.com/show_bug.cgi?id=1263959 +Signed-off-by: Jiří Klimeš +--- + src/devices/wwan/nm-modem-broadband.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/src/devices/wwan/nm-modem-broadband.c b/src/devices/wwan/nm-modem-broadband.c +index e5c77f4..7ec90c3 100644 +--- a/src/devices/wwan/nm-modem-broadband.c ++++ b/src/devices/wwan/nm-modem-broadband.c +@@ -1153,6 +1153,19 @@ sim_changed (MMModem *modem, GParamSpec *pspec, gpointer user_data) + } + + static void ++supported_ip_families_changed (MMModem *modem, GParamSpec *pspec, gpointer user_data) ++{ ++ NMModemBroadband *self = NM_MODEM_BROADBAND (user_data); ++ ++ g_return_if_fail (modem == self->priv->modem_iface); ++ ++ g_object_set (G_OBJECT (self), ++ NM_MODEM_IP_TYPES, ++ mm_ip_family_to_nm (mm_modem_get_supported_ip_families (modem)), ++ NULL); ++} ++ ++static void + nm_modem_broadband_init (NMModemBroadband *self) + { + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, +@@ -1183,6 +1196,10 @@ set_property (GObject *object, + G_CALLBACK (sim_changed), + self); + sim_changed (self->priv->modem_iface, NULL, self); ++ g_signal_connect (self->priv->modem_iface, ++ "notify::supported-ip-families", ++ G_CALLBACK (supported_ip_families_changed), ++ self); + + /* Note: don't grab the Simple iface here; the Modem interface is the + * only one assumed to be always valid and available */ +-- +2.1.0 + diff --git a/SOURCES/0019-rh1267462-fix-supplicant-interface-crash.patch b/SOURCES/0019-rh1267462-fix-supplicant-interface-crash.patch new file mode 100644 index 0000000..9f02406 --- /dev/null +++ b/SOURCES/0019-rh1267462-fix-supplicant-interface-crash.patch @@ -0,0 +1,48 @@ +From 9736327b2616861dfec181e88f908a18b22d781c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= +Date: Thu, 7 May 2015 11:27:26 +0200 +Subject: [PATCH] wifi: fix a crash in on_bss_proxy_acquired() (rh #1266003) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +g_dbus_proxy_get_cached_property_names() function can return NULL. + + Program received signal SIGSEGV, Segmentation fault. + on_bss_proxy_acquired (proxy=0x7fffe4003880 [GDBusProxy], result=0x895490, user_data=) at supplicant-manager/nm-supplicant-interface.c:159 + 159 while (*iter) { + (gdb) bt + #0 0x000000000048fac7 in on_bss_proxy_acquired (proxy=0x7fffe4003880 [GDBusProxy], result=0x895490, user_data=) + at supplicant-manager/nm-supplicant-interface.c:159 + #1 0x0000003bf84728b7 in g_simple_async_result_complete (simple=0x895490 [GSimpleAsyncResult]) at gsimpleasyncresult.c:763 + #2 0x0000003bf8472919 in complete_in_idle_cb (data=) at gsimpleasyncresult.c:775 + #3 0x0000003bf5c497fb in g_main_context_dispatch (context=0x7d6420) at gmain.c:3111 + #4 0x0000003bf5c497fb in g_main_context_dispatch (context=context@entry=0x7d6420) at gmain.c:3710 + #5 0x0000003bf5c49b98 in g_main_context_iterate (context=0x7d6420, block=block@entry=1, dispatch=dispatch@entry=1, self=) at gmain.c:3781 + #6 0x0000003bf5c49ec2 in g_main_loop_run (loop=0x7d64e0) at gmain.c:3975 + #7 0x00000000004349d6 in main (argc=1, argv=0x7fffffffe598) at main.c:486 + +https://bugzilla.redhat.com/show_bug.cgi?id=1266003 + +(cherry picked from commit 33527341b1e35034a4f1736df4bc98f8ac8418ab) +Signed-off-by: Jiří Klimeš +--- + src/supplicant-manager/nm-supplicant-interface.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c +index 66bab2e..08b850a 100644 +--- a/src/supplicant-manager/nm-supplicant-interface.c ++++ b/src/supplicant-manager/nm-supplicant-interface.c +@@ -154,7 +154,7 @@ on_bss_proxy_acquired (GDBusProxy *proxy, GAsyncResult *result, gpointer user_da + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + + iter = properties = g_dbus_proxy_get_cached_property_names (proxy); +- while (*iter) { ++ while (iter && *iter) { + GVariant *copy = g_dbus_proxy_get_cached_property (proxy, *iter); + + g_variant_builder_add (&builder, "{sv}", *iter++, copy); +-- +2.1.0 + diff --git a/SOURCES/0020-rh1264361-platform-link-cache.patch b/SOURCES/0020-rh1264361-platform-link-cache.patch new file mode 100644 index 0000000..6a1afd0 --- /dev/null +++ b/SOURCES/0020-rh1264361-platform-link-cache.patch @@ -0,0 +1,195 @@ +From 891e3b8f1bd14d4f7eea689ec3f0d7c1845d0ccd Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Mon, 14 Sep 2015 16:40:51 +0200 +Subject: [PATCH 1/3] platform: fix handling refresh-link delayed actions + +Due to a bug, we would only handle one REFRESH_LINK delayed action +and ignore the ones queued afterwards. + +Fixes: 051cf8bbde9b73cdb3718be94e78237758b451ff +(cherry picked from commit eee240ffe82d1cf4e3e84688a37fbdc215c119d0) +(cherry picked from commit bdbc3bbb7b919307b0a353b5de6bb1369127df5d) +--- + src/platform/nm-linux-platform.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c +index cd0a4e0..cc24707 100644 +--- a/src/platform/nm-linux-platform.c ++++ b/src/platform/nm-linux-platform.c +@@ -1617,7 +1617,7 @@ delayed_action_handle_one (NMPlatform *platform) + + user_data = priv->delayed_action.list_refresh_link->pdata[0]; + g_ptr_array_remove_index_fast (priv->delayed_action.list_refresh_link, 0); +- if (priv->delayed_action.list_master_connected->len == 0) ++ if (priv->delayed_action.list_refresh_link->len == 0) + priv->delayed_action.flags &= ~DELAYED_ACTION_TYPE_REFRESH_LINK; + nm_assert (_nm_utils_ptrarray_find_first (priv->delayed_action.list_refresh_link->pdata, priv->delayed_action.list_refresh_link->len, user_data) < 0); + +-- +2.4.3 + + +From 211a064f15cbcc63374f14d39d939f0ab6c1070f Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Mon, 14 Sep 2015 15:05:00 +0200 +Subject: [PATCH 2/3] platform: refresh links when parent gets removed + +When moving a link to another netns, it gets removed from +NMPlatform's view. + +Currently kernel does not sent a notification to inform about +that change (see related bug rh#1262908). + +Ensure that we reload all linked interfaces which now might +have an invisible parent. + +(cherry picked from commit 2cd6aaa918333813879c97f7a1cb228e706a0586) +(cherry picked from commit e79caf9b4ad888e9d78c4256f402b9eb8a524641) +--- + src/platform/nm-linux-platform.c | 31 +++++++++++++++++++++++++++++++ + 1 file changed, 31 insertions(+) + +diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c +index cc24707..6b65135 100644 +--- a/src/platform/nm-linux-platform.c ++++ b/src/platform/nm-linux-platform.c +@@ -1869,6 +1869,37 @@ cache_pre_hook (NMPCache *cache, const NMPObject *old, const NMPObject *new, NMP + } + } + { ++ int ifindex = -1; ++ ++ /* removal of a link could be caused by moving the link to another netns. ++ * In this case, we potentially have to update other links that have this link as parent. ++ * Currently, kernel misses to sent us a notification in this case (rh #1262908). */ ++ ++ if ( ops_type == NMP_CACHE_OPS_REMOVED ++ && old /* <-- nonsensical, make coverity happy */ ++ && old->_link.netlink.is_in_netlink) ++ ifindex = old->link.ifindex; ++ else if ( ops_type == NMP_CACHE_OPS_UPDATED ++ && old && new /* <-- nonsensical, make coverity happy */ ++ && old->_link.netlink.is_in_netlink ++ && !new->_link.netlink.is_in_netlink) ++ ifindex = new->link.ifindex; ++ ++ if (ifindex > 0) { ++ const NMPlatformLink *const *links; ++ ++ links = cache_lookup_all_objects (NMPlatformLink, platform, NMP_OBJECT_TYPE_LINK, FALSE); ++ if (links) { ++ for (; *links; links++) { ++ const NMPlatformLink *l = (*links); ++ ++ if (l->parent == ifindex) ++ delayed_action_schedule (platform, DELAYED_ACTION_TYPE_REFRESH_LINK, GINT_TO_POINTER (l->ifindex)); ++ } ++ } ++ } ++ } ++ { + /* if a link goes down, we must refresh routes */ + if ( ops_type == NMP_CACHE_OPS_UPDATED + && old && new /* <-- nonsensical, make coverity happy */ +-- +2.4.3 + + +From 729222d9e2997f262e070c1820b742e6aea07fa7 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Mon, 14 Sep 2015 15:27:36 +0200 +Subject: [PATCH 3/3] platform: cancel delayed action REFRESH_LINK when + receiving an update + +When we receive an update for a link, cancel a scheduled +REFRESH_LINK delayed-action for that ifindex. At the point when we +scheduled refrehing the link, we only cared about receiving a +notification that was newer then the current state. + +We scheduled requesting this new notification to resync the cache. +It is not necessary to actually request a new update, any update we +receive *after* requesting a new update will suffice. + +This potentially saves extra round-trips re-requesting the link. + +(cherry picked from commit f4f4e1cf092ce5236aa9394ad5c485ad1c5885c2) +(cherry picked from commit 91c00072f2fd23e90a840a7c466c3ed95217eb68) +--- + src/platform/nm-linux-platform.c | 43 ++++++++++++++++++++++++++++++++++------ + 1 file changed, 37 insertions(+), 6 deletions(-) + +diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c +index 6b65135..ac6bb05 100644 +--- a/src/platform/nm-linux-platform.c ++++ b/src/platform/nm-linux-platform.c +@@ -1653,6 +1653,33 @@ delayed_action_handle_idle (gpointer user_data) + } + + static void ++delayed_action_clear_REFRESH_LINK (NMPlatform *platform, int ifindex) ++{ ++ NMLinuxPlatformPrivate *priv; ++ gssize idx; ++ gpointer user_data; ++ ++ if (ifindex <= 0) ++ return; ++ ++ priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform); ++ if (!NM_FLAGS_HAS (priv->delayed_action.flags, DELAYED_ACTION_TYPE_REFRESH_LINK)) ++ return; ++ ++ user_data = GINT_TO_POINTER (ifindex); ++ ++ idx = _nm_utils_ptrarray_find_first (priv->delayed_action.list_refresh_link->pdata, priv->delayed_action.list_refresh_link->len, user_data); ++ if (idx < 0) ++ return; ++ ++ _LOGT_delayed_action (DELAYED_ACTION_TYPE_REFRESH_LINK, user_data, "clear"); ++ ++ g_ptr_array_remove_index_fast (priv->delayed_action.list_refresh_link, idx); ++ if (priv->delayed_action.list_refresh_link->len == 0) ++ priv->delayed_action.flags &= ~DELAYED_ACTION_TYPE_REFRESH_LINK; ++} ++ ++static void + delayed_action_schedule (NMPlatform *platform, DelayedActionType action_type, gpointer user_data) + { + NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform); +@@ -2069,9 +2096,11 @@ do_request_all (NMPlatform *platform, DelayedActionType action_type, gboolean ha + + /* clear any delayed action that request a refresh of this object type. */ + priv->delayed_action.flags &= ~iflags; ++ _LOGT_delayed_action (iflags, NULL, "handle (do-request-all)"); + if (obj_type == NMP_OBJECT_TYPE_LINK) { + priv->delayed_action.flags &= ~DELAYED_ACTION_TYPE_REFRESH_LINK; + g_ptr_array_set_size (priv->delayed_action.list_refresh_link, 0); ++ _LOGT_delayed_action (DELAYED_ACTION_TYPE_REFRESH_LINK, NULL, "clear (do-request-all)"); + } + + event_handler_read_netlink_all (platform, FALSE); +@@ -2382,12 +2411,14 @@ event_notification (struct nl_msg *msg, gpointer user_data) + switch (msghdr->nlmsg_type) { + + case RTM_NEWLINK: +- if ( NMP_OBJECT_GET_TYPE (obj) == NMP_OBJECT_TYPE_LINK +- && g_hash_table_lookup (priv->delayed_deletion, obj) != NULL) { +- /* the object is scheduled for delayed deletion. Replace that object +- * by clearing the value from priv->delayed_deletion. */ +- _LOGT ("delayed-deletion: clear delayed deletion of protected object %s", nmp_object_to_string (obj, NMP_OBJECT_TO_STRING_ID, NULL, 0)); +- g_hash_table_insert (priv->delayed_deletion, nmp_object_ref (obj), NULL); ++ if (NMP_OBJECT_GET_TYPE (obj) == NMP_OBJECT_TYPE_LINK) { ++ if (g_hash_table_lookup (priv->delayed_deletion, obj) != NULL) { ++ /* the object is scheduled for delayed deletion. Replace that object ++ * by clearing the value from priv->delayed_deletion. */ ++ _LOGT ("delayed-deletion: clear delayed deletion of protected object %s", nmp_object_to_string (obj, NMP_OBJECT_TO_STRING_ID, NULL, 0)); ++ g_hash_table_insert (priv->delayed_deletion, nmp_object_ref (obj), NULL); ++ } ++ delayed_action_clear_REFRESH_LINK (platform, obj->link.ifindex); + } + /* fall-through */ + case RTM_NEWADDR: +-- +2.4.3 + diff --git a/SOURCES/0021-rh1267672-nmtui-crash-with-secret-agent.patch b/SOURCES/0021-rh1267672-nmtui-crash-with-secret-agent.patch new file mode 100644 index 0000000..d7c9309 --- /dev/null +++ b/SOURCES/0021-rh1267672-nmtui-crash-with-secret-agent.patch @@ -0,0 +1,83 @@ +From 7c4f6915b0e5479c90bc666400f3674cff024acd Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Wed, 30 Sep 2015 17:25:49 +0200 +Subject: [PATCH 1/2] tui: fix crash during activation when failed to create + secret-agent + +NetworkManager only allows one 'client:user-id' to register as secret +agent. Thus, when starting nmtui in two terminals, creating the secret +agent can fail. + +This can lead to a crash. + +https://bugzilla.gnome.org/show_bug.cgi?id=755883 +(cherry picked from commit b861900d45da588f4239be418c3e1f62505cbde1) +(cherry picked from commit 269a4483be917fcc7ba66bcf061f75e76df0c6c7) +--- + clients/tui/nmtui-connect.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/clients/tui/nmtui-connect.c b/clients/tui/nmtui-connect.c +index 438915d..5eabbc8 100644 +--- a/clients/tui/nmtui-connect.c ++++ b/clients/tui/nmtui-connect.c +@@ -132,7 +132,7 @@ activate_connection (NMConnection *connection, + NMObject *specific_object) + { + NmtNewtForm *form; +- NMSecretAgentOld *agent; ++ gs_unref_object NMSecretAgentOld *agent = NULL; + NmtNewtWidget *label; + NmtSyncOp op; + const char *specific_object_path; +@@ -188,7 +188,7 @@ activate_connection (NMConnection *connection, + goto done; + } + +- if (!connection) { ++ if (agent && !connection) { + connection = NM_CONNECTION (nm_active_connection_get_connection (ac)); + if (connection) { + nm_secret_agent_simple_enable (NM_SECRET_AGENT_SIMPLE (agent), +@@ -220,8 +220,8 @@ activate_connection (NMConnection *connection, + nmt_newt_form_quit (form); + g_object_unref (form); + +- nm_secret_agent_old_unregister (agent, NULL, NULL); +- g_object_unref (agent); ++ if (agent) ++ nm_secret_agent_old_unregister (agent, NULL, NULL); + } + + static void +-- +2.4.3 + + +From 74a8e8c9e61f663bed05f004d5e9530c1ea1dbf5 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Wed, 30 Sep 2015 19:37:10 +0200 +Subject: [PATCH 2/2] tui: add a missing include to fix build + +Fixes: 269a4483be917fcc7ba66bcf061f75e76df0c6c7 +(cherry picked from commit e88161172e2d675783027a839b50488cc75fbf6f) +--- + clients/tui/nmtui-connect.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/clients/tui/nmtui-connect.c b/clients/tui/nmtui-connect.c +index 5eabbc8..cacb0b4 100644 +--- a/clients/tui/nmtui-connect.c ++++ b/clients/tui/nmtui-connect.c +@@ -30,6 +30,8 @@ + + #include + ++#include "gsystem-local-alloc.h" ++ + #include "nmt-newt.h" + + #include "nmtui.h" +-- +2.4.3 + diff --git a/SOURCES/0022-rh1268030-vpn-plugin-timeout.patch b/SOURCES/0022-rh1268030-vpn-plugin-timeout.patch new file mode 100644 index 0000000..687e4fe --- /dev/null +++ b/SOURCES/0022-rh1268030-vpn-plugin-timeout.patch @@ -0,0 +1,52 @@ +From f7617511bb94bbae2dbf99231a7d6be29575aa4d Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 1 Oct 2015 17:17:52 +0200 +Subject: [PATCH] nm-vpn-service-plugin: increase the quit timer + +We now (since 3272ff6 libnm/libnm-glib: don't quit in the middle of asking for +secrets) always hook on the quit timer when NM asks the plugin if it needs +secrets. The timer is 20 seconds, which seems too short. + +Let's make it three minutes. Don't bother adding another timer or using a +distinct timeout: it does no harm for the plugin to remain unused for three +minutes on a bus. + +Another option would be to completely unhook it; however the plugin wouldn't +learn if the user cancelled the NM's secrets request and would remain unused +on the bus forever. + +(cherry picked from commit b1512221bc29f24b86d464dc5117439c366fd299) +--- + libnm-glib/nm-vpn-plugin.c | 2 +- + libnm/nm-vpn-plugin-old.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libnm-glib/nm-vpn-plugin.c b/libnm-glib/nm-vpn-plugin.c +index f40ea80..a9c4a1f 100644 +--- a/libnm-glib/nm-vpn-plugin.c ++++ b/libnm-glib/nm-vpn-plugin.c +@@ -69,7 +69,7 @@ static gboolean impl_vpn_plugin_set_failure (NMVPNPlugin *plugin, + + #include "nm-vpn-plugin-glue.h" + +-#define NM_VPN_PLUGIN_QUIT_TIMER 20 ++#define NM_VPN_PLUGIN_QUIT_TIMER 180 + + G_DEFINE_ABSTRACT_TYPE (NMVPNPlugin, nm_vpn_plugin, G_TYPE_OBJECT) + +diff --git a/libnm/nm-vpn-plugin-old.c b/libnm/nm-vpn-plugin-old.c +index 24d8e40..deaa07d 100644 +--- a/libnm/nm-vpn-plugin-old.c ++++ b/libnm/nm-vpn-plugin-old.c +@@ -44,7 +44,7 @@ + + #include "nmdbus-vpn-plugin.h" + +-#define NM_VPN_PLUGIN_OLD_QUIT_TIMER 20 ++#define NM_VPN_PLUGIN_OLD_QUIT_TIMER 180 + + static void nm_vpn_plugin_old_initable_iface_init (GInitableIface *iface); + +-- +2.4.3 + diff --git a/SOURCES/0023-rh1183444-enslave-team.patch b/SOURCES/0023-rh1183444-enslave-team.patch new file mode 100644 index 0000000..0577fbe --- /dev/null +++ b/SOURCES/0023-rh1183444-enslave-team.patch @@ -0,0 +1,237 @@ +From 2e6d8e23b7ee032217d94c7d2dad2a57ace42ba1 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Thu, 1 Oct 2015 16:41:09 +0200 +Subject: [PATCH 1/3] macros: add nm_clear_g_signal_handler() helper + +(cherry picked from commit 720c53f9f14ee3d12cb0a2bf68da938949544275) +--- + include/nm-macros-internal.h | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/include/nm-macros-internal.h b/include/nm-macros-internal.h +index 170fb46..c4a60fa 100644 +--- a/include/nm-macros-internal.h ++++ b/include/nm-macros-internal.h +@@ -24,6 +24,7 @@ + + + #include ++#include + + /********************************************************/ + +@@ -256,6 +257,19 @@ nm_clear_g_source (guint *id) + return FALSE; + } + ++static inline gboolean ++nm_clear_g_signal_handler (gpointer self, guint *id) ++{ ++ g_return_val_if_fail (G_IS_OBJECT (self), FALSE); ++ ++ if (id && *id) { ++ g_signal_handler_disconnect (self, *id); ++ *id = 0; ++ return TRUE; ++ } ++ return FALSE; ++} ++ + /*****************************************************************************/ + + /* Determine whether @x is a power of two (@x being an integer type). +-- +2.4.3 + + +From 5167b6a409ee7b150be181aef7a88f8162118902 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Thu, 1 Oct 2015 16:43:06 +0200 +Subject: [PATCH 2/3] device: use nm_clear_g_signal_handler() to clear + master-ready signal handler + +(cherry picked from commit 86b6b6ed32c5128a4879238e10a7a1e9cda18be5) +--- + src/devices/nm-device.c | 10 ++-------- + 1 file changed, 2 insertions(+), 8 deletions(-) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index 36603a6..4c2ac97 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -2679,10 +2679,7 @@ master_ready_cb (NMActiveConnection *active, + _LOGD (LOGD_DEVICE, "master connection ready; master device %s", + nm_device_get_iface (priv->master)); + +- if (priv->master_ready_id) { +- g_signal_handler_disconnect (active, priv->master_ready_id); +- priv->master_ready_id = 0; +- } ++ nm_clear_g_signal_handler (active, &priv->master_ready_id); + + nm_device_activate_schedule_stage2_device_config (self); + } +@@ -6031,10 +6028,7 @@ clear_act_request (NMDevice *self) + + nm_active_connection_set_default (NM_ACTIVE_CONNECTION (priv->act_request), FALSE); + +- if (priv->master_ready_id) { +- g_signal_handler_disconnect (priv->act_request, priv->master_ready_id); +- priv->master_ready_id = 0; +- } ++ nm_clear_g_signal_handler (priv->act_request, &priv->master_ready_id); + + g_clear_object (&priv->act_request); + g_object_notify (G_OBJECT (self), NM_DEVICE_ACTIVE_CONNECTION); +-- +2.4.3 + + +From b3a02417af7f66e228b970f7306a9865e146ba06 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Thu, 1 Oct 2015 16:48:32 +0200 +Subject: [PATCH 3/3] device: fix activating slave device when stage1 delays + action + +When activating for example a team device which is to be enslaved to a +bridge, nm_device_activate_stage1_device_prepare() will postpone +stage 2. + +In that case, we didn't register the "master-ready" of the team +device and thus never progressed the slave from stage2. + +Reproduce: + + # nmcli connection delete t-br0 + # nmcli connection delete t-team0 + nmcli connection add type bridge con-name t-br0 autoconnect no ifname i-br0 ip4 192.168.177.100/24 gw4 192.168.177.1 + nmcli connection add type team con-name t-team0 autoconnect no ifname i-team0 + nmcli connection modify id t-team0 connection.master i-br0 connection.slave-type bridge + nmcli connection up t-team0 + +(cherry picked from commit 5f8aa51e6358a200feb83378877a4e9cd12cb222) +--- + src/devices/nm-device.c | 63 +++++++++++++++++++++++++++++++------------------ + 1 file changed, 40 insertions(+), 23 deletions(-) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index 4c2ac97..148bef4 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -343,6 +343,7 @@ typedef struct { + /* master interface for bridge/bond/team slave */ + NMDevice * master; + gboolean enslaved; ++ gboolean master_ready_handled; + guint master_ready_id; + + /* slave management */ +@@ -2658,19 +2659,22 @@ get_ip_config_may_fail (NMDevice *self, int family) + } + + static void +-master_ready_cb (NMActiveConnection *active, +- GParamSpec *pspec, +- NMDevice *self) ++master_ready (NMDevice *self, ++ NMActiveConnection *active) + { + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + NMActiveConnection *master; + +- g_assert (priv->state == NM_DEVICE_STATE_PREPARE); ++ g_return_if_fail (priv->state == NM_DEVICE_STATE_PREPARE); ++ g_return_if_fail (!priv->master_ready_handled); + + /* Notify a master device that it has a new slave */ +- g_assert (nm_active_connection_get_master_ready (active)); ++ g_return_if_fail (nm_active_connection_get_master_ready (active)); + master = nm_active_connection_get_master (active); + ++ priv->master_ready_handled = TRUE; ++ nm_clear_g_signal_handler (active, &priv->master_ready_id); ++ + priv->master = g_object_ref (nm_active_connection_get_device (master)); + nm_device_master_add_slave (priv->master, + self, +@@ -2679,8 +2683,14 @@ master_ready_cb (NMActiveConnection *active, + _LOGD (LOGD_DEVICE, "master connection ready; master device %s", + nm_device_get_iface (priv->master)); + +- nm_clear_g_signal_handler (active, &priv->master_ready_id); ++} + ++static void ++master_ready_cb (NMActiveConnection *active, ++ GParamSpec *pspec, ++ NMDevice *self) ++{ ++ master_ready (self, active); + nm_device_activate_schedule_stage2_device_config (self); + } + +@@ -2728,23 +2738,7 @@ nm_device_activate_stage1_device_prepare (gpointer user_data) + g_assert (ret == NM_ACT_STAGE_RETURN_SUCCESS); + } + +- if (nm_active_connection_get_master (active)) { +- /* If the master connection is ready for slaves, attach ourselves */ +- if (nm_active_connection_get_master_ready (active)) +- master_ready_cb (active, NULL, self); +- else { +- _LOGD (LOGD_DEVICE, "waiting for master connection to become ready"); +- +- /* Attach a signal handler and wait for the master connection to begin activating */ +- g_assert (priv->master_ready_id == 0); +- priv->master_ready_id = g_signal_connect (active, +- "notify::" NM_ACTIVE_CONNECTION_INT_MASTER_READY, +- (GCallback) master_ready_cb, +- self); +- /* Postpone */ +- } +- } else +- nm_device_activate_schedule_stage2_device_config (self); ++ nm_device_activate_schedule_stage2_device_config (self); + + out: + _LOGD (LOGD_DEVICE, "Activation: Stage 1 of 5 (Device Prepare) complete."); +@@ -2798,6 +2792,28 @@ nm_device_activate_stage2_device_config (gpointer user_data) + NMActiveConnection *active = NM_ACTIVE_CONNECTION (priv->act_request); + GSList *iter; + ++ if (!priv->master_ready_handled) { ++ if (!nm_active_connection_get_master (active)) ++ priv->master_ready_handled = TRUE; ++ else { ++ /* If the master connection is ready for slaves, attach ourselves */ ++ if (nm_active_connection_get_master_ready (active)) ++ master_ready (self, active); ++ else { ++ _LOGD (LOGD_DEVICE, "waiting for master connection to become ready"); ++ ++ if (priv->master_ready_id == 0) { ++ priv->master_ready_id = g_signal_connect (active, ++ "notify::" NM_ACTIVE_CONNECTION_INT_MASTER_READY, ++ (GCallback) master_ready_cb, ++ self); ++ } ++ /* Postpone */ ++ return FALSE; ++ } ++ } ++ } ++ + /* Clear the activation source ID now that this stage has run */ + activation_source_clear (self, FALSE, 0); + +@@ -6028,6 +6044,7 @@ clear_act_request (NMDevice *self) + + nm_active_connection_set_default (NM_ACTIVE_CONNECTION (priv->act_request), FALSE); + ++ priv->master_ready_handled = FALSE; + nm_clear_g_signal_handler (priv->act_request, &priv->master_ready_id); + + g_clear_object (&priv->act_request); +-- +2.4.3 + diff --git a/SOURCES/0024-rh1183444-enslave-team-fix.patch b/SOURCES/0024-rh1183444-enslave-team-fix.patch new file mode 100644 index 0000000..1831414 --- /dev/null +++ b/SOURCES/0024-rh1183444-enslave-team-fix.patch @@ -0,0 +1,172 @@ +From 04c4fb0a6ed719cfaa6b28c7daae51c0ccb549a2 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Tue, 6 Oct 2015 10:40:45 +0200 +Subject: [PATCH 1/3] device: fix activating master/slave devices during stage2 + +During stage2, if the slave detected that it would need to wait for +the master, it would return FALSE (which removes the g-idle-handler). + +However, it would not clear the activation-source, so later, when +the master becomes ready, its attempt to schedule stage2 again would +result in an error-log and the idle-handler would not be scheduled +again. + +Fixes: 85ac903bb8010409c4010ba09c621780b385b9b5 +https://bugzilla.redhat.com/show_bug.cgi?id=1268797 +https://bugzilla.redhat.com/show_bug.cgi?id=1183444 +(cherry picked from commit c5210b322dd3d5d26d3a3adb6d2ca67a3fc387e0) +(cherry picked from commit 5c20dd9ea36a4bc84d1a32b0e30c8906570d5b02) +--- + src/devices/nm-device.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index 148bef4..7aa9bb5 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -2792,6 +2792,9 @@ nm_device_activate_stage2_device_config (gpointer user_data) + NMActiveConnection *active = NM_ACTIVE_CONNECTION (priv->act_request); + GSList *iter; + ++ /* Clear the activation source ID now that this stage has run */ ++ activation_source_clear (self, FALSE, 0); ++ + if (!priv->master_ready_handled) { + if (!nm_active_connection_get_master (active)) + priv->master_ready_handled = TRUE; +@@ -2814,9 +2817,6 @@ nm_device_activate_stage2_device_config (gpointer user_data) + } + } + +- /* Clear the activation source ID now that this stage has run */ +- activation_source_clear (self, FALSE, 0); +- + _LOGD (LOGD_DEVICE, "Activation: Stage 2 of 5 (Device Configure) starting..."); + nm_device_state_changed (self, NM_DEVICE_STATE_CONFIG, NM_DEVICE_STATE_REASON_NONE); + +-- +2.4.3 + + +From 3d8da19339a3fa5d5e7b66e821d0115ef18b7f17 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Tue, 6 Oct 2015 12:03:51 +0200 +Subject: [PATCH 2/3] device: handle master-ready before scheduling stage2 + +Don't handle master-ready at the beginning of stage2, but instead while +scheduling (and then possibly delaying the scheduling of stage2). + +This seems more idiomatic: + + When inside a stage and your part is done: call schedule-next-stage. + That is, always schedule the next stage, not the current one. + schedule-next-stage then might delay to really scheduling until the + device is ready for the next state. + +Fixes: 85ac903bb8010409c4010ba09c621780b385b9b5 +(cherry picked from commit 7bbc090387d6a1c519c92d957f5746faffb9325c) +(cherry picked from commit 7828003bf8bd21dd821ce448ebd18b8c55cc931d) +--- + src/devices/nm-device.c | 46 ++++++++++++++++++++++++---------------------- + 1 file changed, 24 insertions(+), 22 deletions(-) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index 7aa9bb5..53a702d 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -2795,28 +2795,6 @@ nm_device_activate_stage2_device_config (gpointer user_data) + /* Clear the activation source ID now that this stage has run */ + activation_source_clear (self, FALSE, 0); + +- if (!priv->master_ready_handled) { +- if (!nm_active_connection_get_master (active)) +- priv->master_ready_handled = TRUE; +- else { +- /* If the master connection is ready for slaves, attach ourselves */ +- if (nm_active_connection_get_master_ready (active)) +- master_ready (self, active); +- else { +- _LOGD (LOGD_DEVICE, "waiting for master connection to become ready"); +- +- if (priv->master_ready_id == 0) { +- priv->master_ready_id = g_signal_connect (active, +- "notify::" NM_ACTIVE_CONNECTION_INT_MASTER_READY, +- (GCallback) master_ready_cb, +- self); +- } +- /* Postpone */ +- return FALSE; +- } +- } +- } +- + _LOGD (LOGD_DEVICE, "Activation: Stage 2 of 5 (Device Configure) starting..."); + nm_device_state_changed (self, NM_DEVICE_STATE_CONFIG, NM_DEVICE_STATE_REASON_NONE); + +@@ -2878,6 +2856,30 @@ nm_device_activate_schedule_stage2_device_config (NMDevice *self) + priv = NM_DEVICE_GET_PRIVATE (self); + g_return_if_fail (priv->act_request); + ++ if (!priv->master_ready_handled) { ++ NMActiveConnection *active = NM_ACTIVE_CONNECTION (priv->act_request); ++ ++ if (!nm_active_connection_get_master (active)) ++ priv->master_ready_handled = TRUE; ++ else { ++ /* If the master connection is ready for slaves, attach ourselves */ ++ if (nm_active_connection_get_master_ready (active)) ++ master_ready (self, active); ++ else { ++ _LOGD (LOGD_DEVICE, "waiting for master connection to become ready"); ++ ++ if (priv->master_ready_id == 0) { ++ priv->master_ready_id = g_signal_connect (active, ++ "notify::" NM_ACTIVE_CONNECTION_INT_MASTER_READY, ++ (GCallback) master_ready_cb, ++ self); ++ } ++ /* Postpone */ ++ return; ++ } ++ } ++ } ++ + activation_source_schedule (self, nm_device_activate_stage2_device_config, 0); + + _LOGD (LOGD_DEVICE, "Activation: Stage 2 of 5 (Device Configure) scheduled..."); +-- +2.4.3 + + +From bb73d0a828186ecd7af22fbb56a7faa88cbf71eb Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Tue, 6 Oct 2015 14:18:48 +0200 +Subject: [PATCH 3/3] device: assert that master-ready handler is not scheduled + in schedule_stage2_device_config() + +(cherry picked from commit c41be469ab107ea2b4813bf28a1618572b78aa6a) +(cherry picked from commit 4e0882e9239bffd89fe84df74fb2f0663624fc17) +--- + src/devices/nm-device.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index 53a702d..d566b24 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -2859,9 +2859,10 @@ nm_device_activate_schedule_stage2_device_config (NMDevice *self) + if (!priv->master_ready_handled) { + NMActiveConnection *active = NM_ACTIVE_CONNECTION (priv->act_request); + +- if (!nm_active_connection_get_master (active)) ++ if (!nm_active_connection_get_master (active)) { ++ g_warn_if_fail (!priv->master_ready_id); + priv->master_ready_handled = TRUE; +- else { ++ } else { + /* If the master connection is ready for slaves, attach ourselves */ + if (nm_active_connection_get_master_ready (active)) + master_ready (self, active); +-- +2.4.3 + diff --git a/SOURCES/0025-rh1269520-device-activation-logging.patch b/SOURCES/0025-rh1269520-device-activation-logging.patch new file mode 100644 index 0000000..11493db --- /dev/null +++ b/SOURCES/0025-rh1269520-device-activation-logging.patch @@ -0,0 +1,58 @@ +From 5823bede986202dcb0767d78d6b8a52d9c346b90 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Wed, 7 Oct 2015 15:19:21 +0200 +Subject: [PATCH] device: don't complain about repeated schedules of the same + activation stage + +Can easily happend with a storm of DHCP responses or RAs before the idle +handler has a chance to run. + +https://bugzilla.redhat.com/show_bug.cgi?id=1269520 +(cherry picked from commit 3abe1bb21a58bd943d065ce95886980e081ae48c) +--- + src/devices/nm-device.c | 28 ++++++++++++++++------------ + 1 file changed, 16 insertions(+), 12 deletions(-) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index 89eaaf6..2e60d26 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -2617,19 +2617,23 @@ activation_source_schedule (NMDevice *self, GSourceFunc func, int family) + act_source_func = &priv->act_source_func; + } + +- if (*act_source_id) +- _LOGE (LOGD_DEVICE, "activation stage already scheduled"); +- +- /* Don't bother rescheduling the same function that's about to +- * run anyway. Fixes issues with crappy wireless drivers sending +- * streams of associate events before NM has had a chance to process +- * the first one. +- */ +- if (!*act_source_id || (*act_source_func != func)) { +- activation_source_clear (self, TRUE, family); +- *act_source_id = g_idle_add (func, self); +- *act_source_func = func; ++ if (*act_source_id) { ++ if (*act_source_func == func) { ++ /* Don't bother rescheduling the same function that's about to ++ * run anyway. Fixes issues with crappy wireless drivers sending ++ * streams of associate events before NM has had a chance to process ++ * the first one. ++ */ ++ _LOGD (LOGD_DEVICE, "activation stage already scheduled"); ++ return; ++ } else { ++ _LOGW (LOGD_DEVICE, "a different activation stage already scheduled"); ++ activation_source_clear (self, TRUE, family); ++ } + } ++ ++ *act_source_id = g_idle_add (func, self); ++ *act_source_func = func; + } + + static gboolean +-- +2.4.3 + diff --git a/SOURCES/0026-rh1260727-internal-dhcp6-lease-unref.patch b/SOURCES/0026-rh1260727-internal-dhcp6-lease-unref.patch new file mode 100644 index 0000000..319ca2d --- /dev/null +++ b/SOURCES/0026-rh1260727-internal-dhcp6-lease-unref.patch @@ -0,0 +1,34 @@ +From 95e8b165a7cf8a9f72ccfbc3ca09833c8e2cdb60 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 8 Oct 2015 14:55:36 +0200 +Subject: [PATCH] systemd,dhcpv6: clean up the lease on client reset + +Upstream systemd.git commit 4e3e667 [sd-dhcp6-client: Fix unreferencing +DHCPv6 lease on client reset]. + +Fixed on master already. + +https://bugzilla.redhat.com/show_bug.cgi?id=1260727 +--- + .../systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c +index 8a17a72..6754fe1 100644 +--- a/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c ++++ b/src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c +@@ -285,6 +285,11 @@ static void client_notify(sd_dhcp6_client *client, int event) { + static int client_reset(sd_dhcp6_client *client) { + assert_return(client, -EINVAL); + ++ if (client->lease) { ++ dhcp6_lease_clear_timers(&client->lease->ia); ++ client->lease = sd_dhcp6_lease_unref(client->lease); ++ } ++ + client->receive_message = + sd_event_source_unref(client->receive_message); + +-- +2.4.3 + diff --git a/SOURCES/0027-rh1269199-assume-external-device-race.patch b/SOURCES/0027-rh1269199-assume-external-device-race.patch new file mode 100644 index 0000000..b596696 --- /dev/null +++ b/SOURCES/0027-rh1269199-assume-external-device-race.patch @@ -0,0 +1,116 @@ +From 0551c1cb8106bf3483433fd9da6e391b9c2c2712 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Thu, 8 Oct 2015 11:11:42 +0200 +Subject: [PATCH 1/1] device: fix race wrongly managing external-down device + due to late udev signal + +Executing: + + # brctl addbr lbr0 + # ip addr add 10.1.1.1/24 dev lbr0 + # ip link set lbr0 up + +can result in a race so that NetworkManager would manage the device +(and clear the IP addresses). + +It happens, when NetworkManager first receives platform signals that +the device is already up: + + signal: link changed: 11: lbr0 mtu 1500 arp 1 bridge* not-init addrgenmode eui64 addr D2:A1:B4:17:18:F2 driver bridge + +Note that the device is still unknown via udev (not-init). The +unmanaged-state NM_UNMANAGED_EXTERNAL_DOWN gets cleared, but the +device still stays unmanaged. + +Only afterwards the device is known in udev: + + signal: link changed: 11: lbr0 mtu 1500 arp 1 bridge* init addrgenmode eui64 addr D2:A1:B4:17:18:F2 driver bridge + +At this point, we also clear NM_UNMANAGED_PLATFORM_INIT, making +the device managed with reason NM_DEVICE_STATE_REASON_NOW_MANAGED. +That results in managing the external device. + +Fix that by only clearing NM_UNMANAGED_EXTERNAL_DOWN after the device +is no longer NM_UNMANAGED_PLATFORM_INIT. + +https://bugzilla.redhat.com/show_bug.cgi?id=1269199 + +(cherry picked from commit e29ab54335c6a5ef1ce6bac525f1f18a8e81b96e) +(cherry picked from commit cde15dda2e513517433e6273ca62e8b8c2c35ccb) +--- + src/devices/nm-device.c | 44 ++++++++++++++++++++++++++------------------ + 1 file changed, 26 insertions(+), 18 deletions(-) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index 83cd6e9..7c49f3f 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -1375,6 +1375,8 @@ device_link_changed (NMDevice *self) + NMPlatformLink info; + const NMPlatformLink *pllink; + int ifindex; ++ gboolean emit_link_initialized = FALSE; ++ gboolean was_up; + + priv->device_link_changed_id = 0; + +@@ -1450,8 +1452,29 @@ device_link_changed (NMDevice *self) + if (ip_ifname_changed) + update_dynamic_ip_setup (self); + +- if (priv->up != NM_FLAGS_HAS (info.flags, IFF_UP)) { +- priv->up = NM_FLAGS_HAS (info.flags, IFF_UP); ++ if (priv->ifindex > 0 && !priv->platform_link_initialized && info.initialized) { ++ priv->platform_link_initialized = TRUE; ++ ++ if (nm_platform_link_get_unmanaged (NM_PLATFORM_GET, priv->ifindex, &platform_unmanaged)) { ++ nm_device_set_unmanaged (self, ++ NM_UNMANAGED_DEFAULT, ++ platform_unmanaged, ++ NM_DEVICE_STATE_REASON_USER_REQUESTED); ++ } ++ ++ nm_device_set_unmanaged (self, ++ NM_UNMANAGED_PLATFORM_INIT, ++ FALSE, ++ NM_DEVICE_STATE_REASON_NOW_MANAGED); ++ ++ emit_link_initialized = TRUE; ++ } ++ ++ was_up = priv->up; ++ priv->up = NM_FLAGS_HAS (info.flags, IFF_UP); ++ ++ if ( priv->platform_link_initialized ++ && (emit_link_initialized || priv->up != was_up)) { + + /* Manage externally-created software interfaces only when they are IFF_UP */ + g_assert (priv->ifindex > 0); +@@ -1493,23 +1516,8 @@ device_link_changed (NMDevice *self) + } + } + +- if (priv->ifindex > 0 && !priv->platform_link_initialized && info.initialized) { +- priv->platform_link_initialized = TRUE; +- +- if (nm_platform_link_get_unmanaged (NM_PLATFORM_GET, priv->ifindex, &platform_unmanaged)) { +- nm_device_set_unmanaged (self, +- NM_UNMANAGED_DEFAULT, +- platform_unmanaged, +- NM_DEVICE_STATE_REASON_USER_REQUESTED); +- } +- +- nm_device_set_unmanaged (self, +- NM_UNMANAGED_PLATFORM_INIT, +- FALSE, +- NM_DEVICE_STATE_REASON_NOW_MANAGED); +- ++ if (emit_link_initialized) + g_signal_emit (self, signals[LINK_INITIALIZED], 0); +- } + + return G_SOURCE_REMOVE; + } +-- +2.4.3 + diff --git a/SOURCES/0028-rh1264322-update-vlan-mac-address.patch b/SOURCES/0028-rh1264322-update-vlan-mac-address.patch new file mode 100644 index 0000000..019e277 --- /dev/null +++ b/SOURCES/0028-rh1264322-update-vlan-mac-address.patch @@ -0,0 +1,94 @@ +From 76d8a405e8eda1d6f23dc2146962000e4fba5062 Mon Sep 17 00:00:00 2001 +From: Beniamino Galvani +Date: Tue, 6 Oct 2015 15:21:29 +0200 +Subject: [PATCH] device/vlan: update VLAN MAC address when parent's one + changes + +When a VLAN has a bond as parent device the MAC address of the bond +may change when other devices are enslaved and then the VLAN would +have a MAC which is different from parent's one. + +Let the VLAN device listen for changes in hw-address property of +parent and update its MAC address accordingly. + +https://bugzilla.redhat.com/show_bug.cgi?id=1264322 +(cherry picked from commit e6d7fee5a617632acae02e12b1ec6156842df788) +--- + src/devices/nm-device-vlan.c | 40 ++++++++++++++++++++++++++++++++++++---- + 1 file changed, 36 insertions(+), 4 deletions(-) + +diff --git a/src/devices/nm-device-vlan.c b/src/devices/nm-device-vlan.c +index e523e6b..adfcef3 100644 +--- a/src/devices/nm-device-vlan.c ++++ b/src/devices/nm-device-vlan.c +@@ -56,6 +56,7 @@ typedef struct { + + NMDevice *parent; + guint parent_state_id; ++ guint parent_hwaddr_id; + int vlan_id; + } NMDeviceVlanPrivate; + +@@ -88,6 +89,36 @@ parent_state_changed (NMDevice *parent, + } + + static void ++parent_hwaddr_changed (NMDevice *parent, ++ GParamSpec *pspec, ++ gpointer user_data) ++{ ++ NMDeviceVlan *self = NM_DEVICE_VLAN (user_data); ++ NMConnection *connection; ++ NMSettingWired *s_wired; ++ const char *cloned_mac = NULL; ++ ++ /* Never touch assumed devices */ ++ if (nm_device_uses_assumed_connection (self)) ++ return; ++ ++ connection = nm_device_get_connection (self); ++ if (!connection) ++ return; ++ ++ /* Update the VLAN MAC only if configuration does not specify one */ ++ s_wired = nm_connection_get_setting_wired (connection); ++ if (s_wired) ++ cloned_mac = nm_setting_wired_get_cloned_mac_address (s_wired); ++ ++ if (!cloned_mac) { ++ _LOGD (LOGD_VLAN, "parent hardware address changed"); ++ nm_device_set_hw_addr (self, nm_device_get_hw_address (parent), ++ "set", LOGD_VLAN); ++ } ++} ++ ++static void + nm_device_vlan_set_parent (NMDeviceVlan *self, NMDevice *parent, gboolean construct) + { + NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (self); +@@ -96,10 +127,8 @@ nm_device_vlan_set_parent (NMDeviceVlan *self, NMDevice *parent, gboolean constr + if (parent == priv->parent) + return; + +- if (priv->parent_state_id) { +- g_signal_handler_disconnect (priv->parent, priv->parent_state_id); +- priv->parent_state_id = 0; +- } ++ nm_clear_g_signal_handler (priv->parent, &priv->parent_state_id); ++ nm_clear_g_signal_handler (priv->parent, &priv->parent_hwaddr_id); + g_clear_object (&priv->parent); + + if (parent) { +@@ -109,6 +138,9 @@ nm_device_vlan_set_parent (NMDeviceVlan *self, NMDevice *parent, gboolean constr + G_CALLBACK (parent_state_changed), + device); + ++ priv->parent_hwaddr_id = g_signal_connect (priv->parent, "notify::" NM_DEVICE_HW_ADDRESS, ++ G_CALLBACK (parent_hwaddr_changed), device); ++ + /* Set parent-dependent unmanaged flag */ + if (construct) { + nm_device_set_initial_unmanaged_flag (device, +-- +2.4.3 + diff --git a/SOURCES/0029-rh1269199-assume-external-device-race-2.patch b/SOURCES/0029-rh1269199-assume-external-device-race-2.patch new file mode 100644 index 0000000..1efbb17 --- /dev/null +++ b/SOURCES/0029-rh1269199-assume-external-device-race-2.patch @@ -0,0 +1,45 @@ +From c60b87314500aae0b855870c394662962905de80 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Fri, 9 Oct 2015 21:45:23 +0200 +Subject: [PATCH 1/1] device: fix wrongly managing external-down device due to + not setting EXTERNAL_DOWN + +The unmanaged-flag NM_UNMANAGED_EXTERNAL_DOWN is initially set during +nm_device_finish_init(). But it was only set if the device was down at +that point. + +If due to a race the platform device was not yet initialized, a later +initialization in device_link_changed() would clear NM_UNMANAGED_PLATFORM_INIT. +If the device is not external-down (because it was already up during +nm_device_finish_init()), the device will be managed right away with +reason NM_DEVICE_STATE_REASON_NOW_MANAGED. + +Together with commit e29ab54335c6a5ef1ce6bac525f1f18a8e81b96e, this +is a race that causes a failure to assume the external-down device. + +https://bugzilla.redhat.com/show_bug.cgi?id=1269199 +(cherry picked from commit 120847c8a37cdba9116d26891c8dc725ad8d9100) +(cherry picked from commit a77a3aa7ddc79695d6b30960826306ab98068e1c) +--- + src/devices/nm-device.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index 7c49f3f..5e413ba 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -1144,8 +1144,9 @@ nm_device_finish_init (NMDevice *self) + + /* Do not manage externally created software devices until they are IFF_UP */ + if ( NM_DEVICE_GET_CLASS (self)->can_unmanaged_external_down (self) +- && !nm_platform_link_is_up (NM_PLATFORM_GET, priv->ifindex) +- && priv->ifindex > 0) ++ && priv->ifindex > 0 ++ && ( !priv->up ++ || !priv->platform_link_initialized)) + nm_device_set_initial_unmanaged_flag (self, NM_UNMANAGED_EXTERNAL_DOWN, TRUE); + + if (priv->master) +-- +2.4.3 + diff --git a/SOURCES/0030-rh1183444-nm-clear-g-signal-handler.patch b/SOURCES/0030-rh1183444-nm-clear-g-signal-handler.patch new file mode 100644 index 0000000..e29dcec --- /dev/null +++ b/SOURCES/0030-rh1183444-nm-clear-g-signal-handler.patch @@ -0,0 +1,70 @@ +From 56c5b0af36f7f0bcd73732cf26833a24cf4017ba Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= +Date: Fri, 9 Oct 2015 20:31:29 +0200 +Subject: [PATCH 1/2] macros: allow NULL pointer in nm_clear_g_signal_handler() + +It does not make sense to issue an error. This should be a helper function. +"NetworkManager[18341]: nm_clear_g_signal_handler: assertion 'G_IS_OBJECT (self)' failed" +error started since commit e6d7fee5a617632acae02e12b1ec6156842df788 due to that. + +(cherry picked from commit c33416178f88353b2f424a18c576de09b6ae3215) +(cherry picked from commit 23313d711ff7a328e96d1bc2da084bcb6266b3f0) +--- + include/nm-macros-internal.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/include/nm-macros-internal.h b/include/nm-macros-internal.h +index c4a60fa..4d9979f 100644 +--- a/include/nm-macros-internal.h ++++ b/include/nm-macros-internal.h +@@ -260,7 +260,8 @@ nm_clear_g_source (guint *id) + static inline gboolean + nm_clear_g_signal_handler (gpointer self, guint *id) + { +- g_return_val_if_fail (G_IS_OBJECT (self), FALSE); ++ if (!self) ++ return FALSE; + + if (id && *id) { + g_signal_handler_disconnect (self, *id); +-- +2.4.3 + + +From 92bf4b9f07eb16fdb4eb550dcfb26dae1b167416 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Mon, 12 Oct 2015 11:05:04 +0200 +Subject: [PATCH 2/2] macros: remove early return from + nm_clear_g_signal_handler() + +It is valid to call nm_clear_g_signal_handler() with missing +@self argument if (and only if) the @id is unspecified as well. + +Remove the check for @self to get an assertion in case @id +is missing *and* @self is invalid. In this case, +g_signal_handler_disconnect() will raise a g_critical() for us. + +Fixes: c33416178f88353b2f424a18c576de09b6ae3215 +(cherry picked from commit 76958f94d4f7a8536dc6fa8676bd8de31bc661c1) +(cherry picked from commit 6f06ec0aba97c5dd89ffbe0f3592f3979d86d223) +--- + include/nm-macros-internal.h | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/include/nm-macros-internal.h b/include/nm-macros-internal.h +index 4d9979f..3c5adcc 100644 +--- a/include/nm-macros-internal.h ++++ b/include/nm-macros-internal.h +@@ -260,9 +260,6 @@ nm_clear_g_source (guint *id) + static inline gboolean + nm_clear_g_signal_handler (gpointer self, guint *id) + { +- if (!self) +- return FALSE; +- + if (id && *id) { + g_signal_handler_disconnect (self, *id); + *id = 0; +-- +2.4.3 + diff --git a/SOURCES/0031-rh1272974-detect-s390-ctc-device.path b/SOURCES/0031-rh1272974-detect-s390-ctc-device.path new file mode 100644 index 0000000..8812e52 --- /dev/null +++ b/SOURCES/0031-rh1272974-detect-s390-ctc-device.path @@ -0,0 +1,54 @@ +From 9041fed9e2c65aee0795bd202747c4489903daef Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Fri, 16 Oct 2015 11:52:30 +0200 +Subject: [PATCH 1/1] platform: fix link-detection for s390 CTC-type devices + +Commit 02c6a9334335d3ef32c6cc8fafc6cea235c80ffc (rh#1212118) +introduced detection of CTC devices based on the driver name. + +That was broken a while ago while refactoring. + +Related: https://bugzilla.redhat.com/show_bug.cgi?id=1212118 +https://bugzilla.redhat.com/show_bug.cgi?id=1272974 + +Fixes: ddaea22332907c05222cbec1e1b4365689fbda9f +(cherry picked from commit 8a6afe92c18dfefa91d057518be00b0127720fa5) +(cherry picked from commit 2a8c93e940c3fdc5bb710f9fd1ec037e51524ed9) +--- + src/platform/nm-linux-platform.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c +index ac6bb05..a218edb 100644 +--- a/src/platform/nm-linux-platform.c ++++ b/src/platform/nm-linux-platform.c +@@ -944,18 +944,18 @@ link_extract_type (NMPlatform *platform, struct rtnl_link *rtnllink, gboolean *c + gs_free char *anycast_mask = NULL; + gs_free char *devtype = NULL; + +- if (arptype == 256) { +- /* Some s390 CTC-type devices report 256 for the encapsulation type +- * for some reason, but we need to call them Ethernet. +- */ +- if (!g_strcmp0 (driver, "ctcm")) +- return NM_LINK_TYPE_ETHERNET; +- } +- + /* Fallback OVS detection for kernel <= 3.16 */ + if (nmp_utils_ethtool_get_driver_info (ifname, &driver, NULL, NULL)) { + if (!g_strcmp0 (driver, "openvswitch")) + return NM_LINK_TYPE_OPENVSWITCH; ++ ++ if (arptype == 256) { ++ /* Some s390 CTC-type devices report 256 for the encapsulation type ++ * for some reason, but we need to call them Ethernet. ++ */ ++ if (!g_strcmp0 (driver, "ctcm")) ++ return NM_LINK_TYPE_ETHERNET; ++ } + } + + sysfs_path = g_strdup_printf ("/sys/class/net/%s", ifname); +-- +2.4.3 + diff --git a/SOURCES/0032-rh1079353-carrier-wait.patch b/SOURCES/0032-rh1079353-carrier-wait.patch new file mode 100644 index 0000000..fc43a71 --- /dev/null +++ b/SOURCES/0032-rh1079353-carrier-wait.patch @@ -0,0 +1,193 @@ +From 2b62887a170766241826ae8747c46d9b74c399ca Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Mon, 19 Oct 2015 14:14:17 +0200 +Subject: [PATCH 1/4] manager: fix activation without specified device + +For an explicit user-request, we relax some checks when searching for a suitable +device; such as requiring-carrier. + +Without this patch, a connection-up while the device has no carrier yet, +would fail right away with "No suitable device found for this connection." + +https://bugzilla.redhat.com/show_bug.cgi?id=1079353 +Fixes: 0bfe635119facb8514e8f5824f599f4c4c3514e2 +(cherry picked from commit cff3e93527b589138efa4beb829e5ed875e40973) +(cherry picked from commit 31b594561c08be233ef1e91734d9efe979d65954) +--- + src/nm-manager.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/src/nm-manager.c b/src/nm-manager.c +index d91a0d7..a6c23b1 100644 +--- a/src/nm-manager.c ++++ b/src/nm-manager.c +@@ -2088,20 +2088,24 @@ nm_manager_get_connection_device (NMManager *self, + + static NMDevice * + nm_manager_get_best_device_for_connection (NMManager *self, +- NMConnection *connection) ++ NMConnection *connection, ++ gboolean for_user_request) + { + const GSList *devices, *iter; + NMDevice *act_device = nm_manager_get_connection_device (self, connection); ++ NMDeviceCheckConAvailableFlags flags; + + if (act_device) + return act_device; + ++ flags = for_user_request ? NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST : NM_DEVICE_CHECK_CON_AVAILABLE_NONE; ++ + /* Pick the first device that's compatible with the connection. */ + devices = nm_manager_get_devices (self); + for (iter = devices; iter; iter = g_slist_next (iter)) { + NMDevice *device = NM_DEVICE (iter->data); + +- if (nm_device_check_connection_available (device, connection, NM_DEVICE_CHECK_CON_AVAILABLE_NONE, NULL)) ++ if (nm_device_check_connection_available (device, connection, flags, NULL)) + return device; + } + +@@ -2581,7 +2585,7 @@ autoconnect_slaves (NMManager *manager, + nm_manager_activate_connection (manager, + slave_connection, + NULL, +- nm_manager_get_best_device_for_connection (manager, slave_connection), ++ nm_manager_get_best_device_for_connection (manager, slave_connection, FALSE), + subject, + &local_err); + if (local_err) { +@@ -3092,7 +3096,7 @@ validate_activation_request (NMManager *self, + goto error; + } + } else +- device = nm_manager_get_best_device_for_connection (self, connection); ++ device = nm_manager_get_best_device_for_connection (self, connection, TRUE); + + if (!device) { + gboolean is_software = nm_connection_is_virtual (connection); +-- +2.4.3 + + +From 0ffd074d4ef555984542ce05f93c839487acfaca Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Mon, 19 Oct 2015 14:26:52 +0200 +Subject: [PATCH 2/4] device: refactor using nm_clear_g_source() for + priv->carrier_wait_id + +(cherry picked from commit c89fd1ea76421ab63bbc227e4c12924f197e6585) +(cherry picked from commit 971a7611bdab8da2c1f6f3ef199f99999202b93a) +--- + src/devices/nm-device.c | 13 +++---------- + 1 file changed, 3 insertions(+), 10 deletions(-) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index 5e413ba..8b2fa33 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -1325,9 +1325,7 @@ nm_device_set_carrier (NMDevice *self, gboolean carrier) + link_disconnect_action_cancel (self); + klass->carrier_changed (self, TRUE); + +- if (priv->carrier_wait_id) { +- g_source_remove (priv->carrier_wait_id); +- priv->carrier_wait_id = 0; ++ if (nm_clear_g_source (&priv->carrier_wait_id)) { + nm_device_remove_pending_action (self, "carrier wait", TRUE); + _carrier_wait_check_queued_act_request (self); + } +@@ -7113,9 +7111,7 @@ nm_device_bring_up (NMDevice *self, gboolean block, gboolean *no_firmware) + * a timeout is reached. + */ + if (nm_device_has_capability (self, NM_DEVICE_CAP_CARRIER_DETECT)) { +- if (priv->carrier_wait_id) +- g_source_remove (priv->carrier_wait_id); +- else ++ if (!nm_clear_g_source (&priv->carrier_wait_id)) + nm_device_add_pending_action (self, "carrier wait", TRUE); + priv->carrier_wait_id = g_timeout_add_seconds (5, carrier_wait_timeout, self); + } +@@ -9245,10 +9241,7 @@ dispose (GObject *object) + + g_hash_table_remove_all (priv->available_connections); + +- if (priv->carrier_wait_id) { +- g_source_remove (priv->carrier_wait_id); +- priv->carrier_wait_id = 0; +- } ++ nm_clear_g_source (&priv->carrier_wait_id); + + _clear_queued_act_request (priv); + +-- +2.4.3 + + +From 3b25f451e30a89c5a136f1644fc761934c97b556 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Mon, 19 Oct 2015 14:44:38 +0200 +Subject: [PATCH 3/4] device: don't wait for carrier when activating static + connection + +When the connection to be activated doesn't require carrier, +don't queue it to wait for it. + +https://bugzilla.redhat.com/show_bug.cgi?id=1079353 +Fixes: 0bfe635119facb8514e8f5824f599f4c4c3514e2 +(cherry picked from commit 118de885eab0a161db291f1c2fb14690b891b00e) +(cherry picked from commit be3aee8b32b448e61b87d1e050f6c1a9d6a61afc) +--- + src/devices/nm-device.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index 8b2fa33..c2a2b8a 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -6379,6 +6379,8 @@ _carrier_wait_check_act_request_must_queue (NMDevice *self, NMActRequest *req) + return FALSE; + + connection = nm_act_request_get_connection (req); ++ if (!connection_requires_carrier (connection)) ++ return FALSE; + + if (!nm_device_check_connection_available (self, connection, NM_DEVICE_CHECK_CON_AVAILABLE_ALL, NULL)) { + /* We passed all @flags we have, and no @specific_object. +-- +2.4.3 + + +From 6287e99516aa822cdd546f57093197ebe962bf1c Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Mon, 19 Oct 2015 15:16:20 +0200 +Subject: [PATCH 4/4] device: properly cancel queued activation request + +We would leak the NMActivationRequest when carrier didn't +come within timeout. We must properly set the state of the +activation request. + +https://bugzilla.redhat.com/show_bug.cgi?id=1079353 +Fixes: 0bfe635119facb8514e8f5824f599f4c4c3514e2 +(cherry picked from commit 839330cd39df8bb1c54cb35ce81f7c381b9090d1) +(cherry picked from commit d65897222acbda41442b4968d004a60c7cec57a4) +--- + src/devices/nm-device.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index c2a2b8a..d4627ec 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -6355,7 +6355,7 @@ _carrier_wait_check_queued_act_request (NMDevice *self) + priv->queued_act_request_is_waiting_for_carrier = FALSE; + if (!priv->carrier) { + _LOGD (LOGD_DEVICE, "Cancel queued activation request as we have no carrier after timeout"); +- g_clear_object (&priv->queued_act_request); ++ _clear_queued_act_request (priv); + } else { + _LOGD (LOGD_DEVICE, "Activate queued activation request as we now have carrier"); + queued_req = priv->queued_act_request; +-- +2.4.3 + diff --git a/SOURCES/0033-rh1270194-wol-default-ignore.patch b/SOURCES/0033-rh1270194-wol-default-ignore.patch new file mode 100644 index 0000000..ced585d --- /dev/null +++ b/SOURCES/0033-rh1270194-wol-default-ignore.patch @@ -0,0 +1,550 @@ +From 0a37f5cc3ebcf93e1ed52d3e5fc5f75d48518804 Mon Sep 17 00:00:00 2001 +From: Beniamino Galvani +Date: Mon, 21 Sep 2015 18:24:07 +0200 +Subject: [PATCH 1/4] wake-on-lan: add option to keep existing settings + +Add a new 'ignore' option to NMSettingWired.wake-on-lan which disables +management of wake-on-lan by NetworkManager (i.e. the pre-existing +option will not be touched). Also, change the default behavior to be +'ignore' instead of 'disabled'. + +https://bugzilla.gnome.org/show_bug.cgi?id=755182 +(cherry picked from commit e587dcb16eb045f55f6cba45987be75f83d0c230) +--- + clients/cli/settings.c | 13 ++++++++----- + libnm-core/nm-setting-wired.c | 11 +++++++---- + libnm-core/nm-setting-wired.h | 19 ++++++++++++++----- + src/devices/nm-device-ethernet.c | 11 +++++++++-- + src/platform/nm-platform-utils.c | 3 +++ + src/settings/plugins/ifcfg-rh/reader.c | 21 +++++++++++++-------- + src/settings/plugins/ifcfg-rh/writer.c | 4 +++- + 7 files changed, 57 insertions(+), 25 deletions(-) + +diff --git a/clients/cli/settings.c b/clients/cli/settings.c +index 2b42eb4..efac7b2 100644 +--- a/clients/cli/settings.c ++++ b/clients/cli/settings.c +@@ -1545,7 +1545,10 @@ nmc_property_wired_set_wake_on_lan (NMSetting *setting, const char *prop, + gboolean ret; + long int t; + +- if (nmc_string_to_int_base (val, 0, TRUE, 0, NM_SETTING_WIRED_WAKE_ON_LAN_ALL, &t)) ++ if (nmc_string_to_int_base (val, 0, TRUE, 0, ++ NM_SETTING_WIRED_WAKE_ON_LAN_ALL ++ | NM_SETTING_WIRED_WAKE_ON_LAN_EXCLUSIVE_FLAGS, ++ &t)) + wol = (NMSettingWiredWakeOnLan) t; + else { + ret = nm_utils_enum_from_str (nm_setting_wired_wake_on_lan_get_type (), val, +@@ -1557,7 +1560,7 @@ nmc_property_wired_set_wake_on_lan (NMSetting *setting, const char *prop, + || g_ascii_strcasecmp (err_token, "disabled") == 0) + wol = NM_SETTING_WIRED_WAKE_ON_LAN_NONE; + else { +- g_set_error (error, 1, 0, _("invalid option '%s', use a combination of [%s] or 'default' or 'none'"), ++ g_set_error (error, 1, 0, _("invalid option '%s', use a combination of [%s] or 'ignore', 'default' or 'none'"), + err_token, + nm_utils_enum_to_str (nm_setting_wired_wake_on_lan_get_type (), + NM_SETTING_WIRED_WAKE_ON_LAN_ALL)); +@@ -1566,9 +1569,9 @@ nmc_property_wired_set_wake_on_lan (NMSetting *setting, const char *prop, + } + } + +- if (NM_FLAGS_HAS (wol, NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT) && +- NM_FLAGS_ANY (wol, NM_SETTING_WIRED_WAKE_ON_LAN_ALL)) { +- g_set_error_literal (error, 1, 0, _("'default' is incompatible with other flags")); ++ if ( NM_FLAGS_ANY (wol, NM_SETTING_WIRED_WAKE_ON_LAN_EXCLUSIVE_FLAGS) ++ && !nm_utils_is_power_of_two (wol)) { ++ g_set_error_literal (error, 1, 0, _("'default' and 'ignore' are incompatible with other flags")); + return FALSE; + } + +diff --git a/libnm-core/nm-setting-wired.c b/libnm-core/nm-setting-wired.c +index 3d0c5b6..c38b187 100644 +--- a/libnm-core/nm-setting-wired.c ++++ b/libnm-core/nm-setting-wired.c +@@ -696,12 +696,12 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) + return FALSE; + } + +- if ( NM_FLAGS_HAS (priv->wol, NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT) +- && NM_FLAGS_ANY (priv->wol, NM_SETTING_WIRED_WAKE_ON_LAN_ALL)) { ++ if ( NM_FLAGS_ANY (priv->wol, NM_SETTING_WIRED_WAKE_ON_LAN_EXCLUSIVE_FLAGS) ++ && !nm_utils_is_power_of_two (priv->wol)) { + g_set_error_literal (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, +- _("Wake-on-LAN mode 'default' is incompatible with other flags")); ++ _("Wake-on-LAN mode 'default' and 'ignore' are exclusive flags")); + g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRED_SETTING_NAME, NM_SETTING_WIRED_WAKE_ON_LAN); + return FALSE; + } +@@ -1190,7 +1190,10 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class) + * May be any combination of %NM_SETTING_WIRED_WAKE_ON_LAN_PHY, + * %NM_SETTING_WIRED_WAKE_ON_LAN_UNICAST, %NM_SETTING_WIRED_WAKE_ON_LAN_MULTICAST, + * %NM_SETTING_WIRED_WAKE_ON_LAN_BROADCAST, %NM_SETTING_WIRED_WAKE_ON_LAN_ARP, +- * %NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC. ++ * %NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC or the special values ++ * %NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT (to use global settings) and ++ * %NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE (to disable management of Wake-on-LAN in ++ * NetworkManager). + * + * Since: 1.0.6 + **/ +diff --git a/libnm-core/nm-setting-wired.h b/libnm-core/nm-setting-wired.h +index 44b7c4d..e1fd6f6 100644 +--- a/libnm-core/nm-setting-wired.h ++++ b/libnm-core/nm-setting-wired.h +@@ -43,14 +43,19 @@ G_BEGIN_DECLS + /** + * NMSettingWiredWakeOnLan: + * @NM_SETTING_WIRED_WAKE_ON_LAN_NONE: Wake-on-LAN disabled +- * @NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT: Use the default value + * @NM_SETTING_WIRED_WAKE_ON_LAN_PHY: Wake on PHY activity + * @NM_SETTING_WIRED_WAKE_ON_LAN_UNICAST: Wake on unicast messages + * @NM_SETTING_WIRED_WAKE_ON_LAN_MULTICAST: Wake on multicast messages + * @NM_SETTING_WIRED_WAKE_ON_LAN_BROADCAST: Wake on broadcast messages + * @NM_SETTING_WIRED_WAKE_ON_LAN_ARP: Wake on ARP + * @NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC: Wake on magic packet +- * @NM_SETTING_WIRED_WAKE_ON_LAN_ALL: Wake on all events ++ * @NM_SETTING_WIRED_WAKE_ON_LAN_ALL: Wake on all events. This does not ++ * include the exclusive flags @NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT or ++ * @NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE. ++ * @NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT: Use the default value ++ * @NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE: Don't change configured settings ++ * @NM_SETTING_WIRED_WAKE_ON_LAN_EXCLUSIVE_FLAGS: Mask of flags that are ++ * incompatible with other flags + * + * Options for #NMSettingWired:wake-on-lan. Note that not all options + * are supported by all devices. +@@ -59,15 +64,19 @@ G_BEGIN_DECLS + */ + typedef enum { /*< flags >*/ + NM_SETTING_WIRED_WAKE_ON_LAN_NONE = 0, /*< skip >*/ +- NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT = (1 << 0), + NM_SETTING_WIRED_WAKE_ON_LAN_PHY = (1 << 1), + NM_SETTING_WIRED_WAKE_ON_LAN_UNICAST = (1 << 2), + NM_SETTING_WIRED_WAKE_ON_LAN_MULTICAST = (1 << 3), + NM_SETTING_WIRED_WAKE_ON_LAN_BROADCAST = (1 << 4), + NM_SETTING_WIRED_WAKE_ON_LAN_ARP = (1 << 5), + NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC = (1 << 6), +- _NM_SETTING_WIRED_WAKE_ON_LAN_LAST, /*< skip >*/ +- NM_SETTING_WIRED_WAKE_ON_LAN_ALL = (((_NM_SETTING_WIRED_WAKE_ON_LAN_LAST - 1) << 1) - 1 - NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT) /*< skip >*/ ++ ++ _NM_SETTING_WIRED_WAKE_ON_LAN_LAST_OPT, /*< skip >*/ ++ NM_SETTING_WIRED_WAKE_ON_LAN_ALL = (((_NM_SETTING_WIRED_WAKE_ON_LAN_LAST_OPT - 1) << 1) - 1) - (1 << 0 /*DEFAULT*/), /*< skip >*/ ++ ++ NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT = (1 << 0), ++ NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE = (1 << 15), ++ NM_SETTING_WIRED_WAKE_ON_LAN_EXCLUSIVE_FLAGS = NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT | NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE, /*< skip >*/ + } NMSettingWiredWakeOnLan; + + #define NM_SETTING_WIRED_PORT "port" +diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c +index beb86e1..7c0de88 100644 +--- a/src/devices/nm-device-ethernet.c ++++ b/src/devices/nm-device-ethernet.c +@@ -1195,15 +1195,22 @@ wake_on_lan_enable (NMDevice *device) + value = nm_config_data_get_connection_default (NM_CONFIG_GET_DATA, + "ethernet.wake-on-lan", + device); ++ + if (value) { + wol = _nm_utils_ascii_str_to_int64 (value, 10, + NM_SETTING_WIRED_WAKE_ON_LAN_NONE, +- NM_SETTING_WIRED_WAKE_ON_LAN_ALL, ++ G_MAXINT32, + NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT); ++ ++ if ( NM_FLAGS_ANY (wol, NM_SETTING_WIRED_WAKE_ON_LAN_EXCLUSIVE_FLAGS) ++ && !nm_utils_is_power_of_two (wol)) { ++ nm_log_dbg (LOGD_ETHER, "invalid default value %u for wake-on-lan", (guint) wol); ++ wol = NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT; ++ } + if (wol != NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT) + goto found; + } +- wol = NM_SETTING_WIRED_WAKE_ON_LAN_NONE; ++ wol = NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE; + found: + return nmp_utils_ethtool_set_wake_on_lan (nm_device_get_iface (device), wol, password); + } +diff --git a/src/platform/nm-platform-utils.c b/src/platform/nm-platform-utils.c +index 051a873..e9b8d4b 100644 +--- a/src/platform/nm-platform-utils.c ++++ b/src/platform/nm-platform-utils.c +@@ -279,6 +279,9 @@ nmp_utils_ethtool_set_wake_on_lan (const char *ifname, + { + struct ethtool_wolinfo wol_info = { }; + ++ if (wol == NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE) ++ return TRUE; ++ + nm_log_dbg (LOGD_PLATFORM, "setting Wake-on-LAN options 0x%x, password '%s'", + (unsigned int) wol, wol_password); + +diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c +index 5bba38f..845b139 100644 +--- a/src/settings/plugins/ifcfg-rh/reader.c ++++ b/src/settings/plugins/ifcfg-rh/reader.c +@@ -3506,18 +3506,23 @@ wireless_connection_from_ifcfg (const char *file, + static void + parse_ethtool_options (shvarFile *ifcfg, NMSettingWired *s_wired, char *value) + { +- NMSettingWiredWakeOnLan wol_flags = NM_SETTING_WIRED_WAKE_ON_LAN_NONE; ++ NMSettingWiredWakeOnLan wol_flags = NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE; + gboolean use_password = FALSE; +- char **words, **iter, *flag; ++ char **words = NULL, **iter = NULL, *flag; + +- if (!value || !value[0]) ++ if (!value) + return; + +- words = g_strsplit_set (value, " ", 0); +- iter = words; ++ if (value[0]) { ++ words = g_strsplit_set (value, " ", 0); ++ iter = words; ++ } + +- while (iter[0]) { ++ while (iter && iter[0]) { + if (g_str_equal (iter[0], "wol") && iter[1] && *iter[1]) { ++ ++ wol_flags = NM_SETTING_WIRED_WAKE_ON_LAN_NONE; ++ + for (flag = iter[1]; *flag; flag++) { + switch (*flag) { + case 'p': +@@ -3553,7 +3558,6 @@ parse_ethtool_options (shvarFile *ifcfg, NMSettingWired *s_wired, char *value) + if (!NM_FLAGS_HAS (wol_flags, NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC)) + use_password = FALSE; + +- g_object_set (s_wired, NM_SETTING_WIRED_WAKE_ON_LAN, wol_flags, NULL); + iter += 2; + continue; + } +@@ -3574,6 +3578,7 @@ parse_ethtool_options (shvarFile *ifcfg, NMSettingWired *s_wired, char *value) + iter++; + } + ++ g_object_set (s_wired, NM_SETTING_WIRED_WAKE_ON_LAN, wol_flags, NULL); + g_strfreev (words); + } + +@@ -3712,7 +3717,7 @@ make_wired_setting (shvarFile *ifcfg, + g_free (value); + } + +- value = svGetValue (ifcfg, "ETHTOOL_OPTS", FALSE); ++ value = svGetValueFull (ifcfg, "ETHTOOL_OPTS", FALSE); + parse_ethtool_options (ifcfg, s_wired, value); + g_free (value); + +diff --git a/src/settings/plugins/ifcfg-rh/writer.c b/src/settings/plugins/ifcfg-rh/writer.c +index 69b7d64..4f9498b 100644 +--- a/src/settings/plugins/ifcfg-rh/writer.c ++++ b/src/settings/plugins/ifcfg-rh/writer.c +@@ -1137,7 +1137,9 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) + + wol = nm_setting_wired_get_wake_on_lan (s_wired); + wol_password = nm_setting_wired_get_wake_on_lan_password (s_wired); +- if (wol == NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT) ++ if (wol == NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE) ++ svSetValueFull (ifcfg, "ETHTOOL_OPTS", "", FALSE); ++ else if (wol == NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT) + svSetValue (ifcfg, "ETHTOOL_OPTS", NULL, FALSE); + else { + str = g_string_sized_new (30); +-- +2.4.3 + +From 4bfa6ec3f2a5579d4898b656575df17681780075 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Thu, 24 Sep 2015 17:31:19 +0200 +Subject: [PATCH 2/4] ifcfg-rh: improve parsing of Wake-on-LAN options + +Initscripts do: + oldifs=$IFS; + IFS=';'; + [ -n "${ETHTOOL_DELAY}" ] && /bin/usleep ${ETHTOOL_DELAY} + for opts in $ETHTOOL_OPTS ; do + IFS=$oldifs; + if [[ "${opts}" =~ [[:space:]]*- ]]; then + /sbin/ethtool $opts + else + /sbin/ethtool -s ${REALDEVICE} $opts + fi + IFS=';'; + done + IFS=$oldifs; + +thus, we want to split on ';', otherwise we parse + "wol d;something else" +wrong. + +Also, g_strsplit_set() returns multiple empty tokens. So +we must skip over empty tokens in case of "wol d". + +The @use_password was wrong, because we would warn if sopass is specified +before wol: + "sopass AA:BB:CC:DD:EE:FF wol g" + +More resilently handle wrong configurations: + "wol pu wol m" => gives m. + "wol pu wol" => should give NONE and warn (instead of "pu"). + +Also accept tab as separator. + +(cherry picked from commit bd1c0086bd17e8ff2852eec530d48dc3136e915b) +--- + src/settings/plugins/ifcfg-rh/reader.c | 114 +++++++++++++++------ + .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 3 +- + 2 files changed, 81 insertions(+), 36 deletions(-) + +diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c +index 845b139..e45ad63 100644 +--- a/src/settings/plugins/ifcfg-rh/reader.c ++++ b/src/settings/plugins/ifcfg-rh/reader.c +@@ -3504,26 +3504,49 @@ wireless_connection_from_ifcfg (const char *file, + } + + static void +-parse_ethtool_options (shvarFile *ifcfg, NMSettingWired *s_wired, char *value) ++parse_ethtool_option (const char *value, NMSettingWiredWakeOnLan *out_flags, char **out_password) + { +- NMSettingWiredWakeOnLan wol_flags = NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE; +- gboolean use_password = FALSE; +- char **words = NULL, **iter = NULL, *flag; ++ gs_strfreev char **words = NULL; ++ const char **iter = NULL, *flag; ++ gboolean has_flags = FALSE; ++ gboolean has_password = FALSE; + +- if (!value) ++ if (!value || !value[0]) + return; + +- if (value[0]) { +- words = g_strsplit_set (value, " ", 0); +- iter = words; +- } ++ words = g_strsplit_set (value, "\t ", 0); ++ iter = (const char **) words; ++ ++ while (iter[0]) { ++ gboolean is_wol; ++ ++ if (g_str_equal (iter[0], "wol")) ++ is_wol = TRUE; ++ else if (g_str_equal (iter[0], "sopass")) ++ is_wol = FALSE; ++ else { ++ /* Silently skip unknown options */ ++ iter++; ++ continue; ++ } ++ ++ iter++; ++ ++ /* g_strsplit_set() returns empty tokens, meaning that we must skip over repeated ++ * space characters like to parse "wol d". */ ++ while (iter[0] && !*iter[0]) ++ iter++; + +- while (iter && iter[0]) { +- if (g_str_equal (iter[0], "wol") && iter[1] && *iter[1]) { ++ if (is_wol) { ++ NMSettingWiredWakeOnLan wol_flags = NM_SETTING_WIRED_WAKE_ON_LAN_NONE; ++ has_flags = TRUE; + +- wol_flags = NM_SETTING_WIRED_WAKE_ON_LAN_NONE; ++ if (!iter[0]) { ++ PARSE_WARNING ("Wake-on-LAN options missing"); ++ break; ++ } + +- for (flag = iter[1]; *flag; flag++) { ++ for (flag = iter[0]; *flag; flag++) { + switch (*flag) { + case 'p': + wol_flags |= NM_SETTING_WIRED_WAKE_ON_LAN_PHY; +@@ -3544,42 +3567,65 @@ parse_ethtool_options (shvarFile *ifcfg, NMSettingWired *s_wired, char *value) + wol_flags |= NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC; + break; + case 's': +- use_password = TRUE; + break; + case 'd': + wol_flags = NM_SETTING_WIRED_WAKE_ON_LAN_NONE; +- use_password = FALSE; + break; + default: + PARSE_WARNING ("unrecognized Wake-on-LAN option '%c'", *flag); + } + } + +- if (!NM_FLAGS_HAS (wol_flags, NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC)) +- use_password = FALSE; ++ *out_flags = wol_flags; ++ } else { ++ has_password = TRUE; + +- iter += 2; +- continue; +- } ++ if (!iter[0]) { ++ PARSE_WARNING ("Wake-on-LAN password missing"); ++ break; ++ } + +- if (g_str_equal (iter[0], "sopass") && iter[1] && *iter[1]) { +- if (use_password) { +- if (nm_utils_hwaddr_valid (iter[1], ETH_ALEN)) +- g_object_set (s_wired, NM_SETTING_WIRED_WAKE_ON_LAN_PASSWORD, iter[1], NULL); +- else +- PARSE_WARNING ("Wake-on-LAN password '%s' is invalid", iter[1]); +- } else +- PARSE_WARNING ("Wake-on-LAN password not expected"); +- iter += 2; +- continue; +- } + +- /* Silently skip unknown options */ ++ g_clear_pointer (out_password, g_free); ++ if (nm_utils_hwaddr_valid (iter[0], ETH_ALEN)) ++ *out_password = g_strdup (iter[0]); ++ else ++ PARSE_WARNING ("Wake-on-LAN password '%s' is invalid", iter[0]); ++ } + iter++; + } ++} ++ ++static void ++parse_ethtool_options (shvarFile *ifcfg, NMSettingWired *s_wired, const char *value) ++{ ++ NMSettingWiredWakeOnLan wol_flags = NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT; ++ gs_free char *wol_password = NULL; ++ gboolean ignore_wol_password = FALSE; ++ ++ if (value) { ++ gs_strfreev char **opts = NULL; ++ const char **iter; ++ ++ wol_flags = NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE; ++ ++ opts = g_strsplit_set (value, ";", 0); ++ for (iter = (const char **) opts; iter[0]; iter++) { ++ /* in case of repeated wol_passwords, parse_ethtool_option() ++ * will do the right thing and clear wol_password before resetting. */ ++ parse_ethtool_option (iter[0], &wol_flags, &wol_password); ++ } ++ } + +- g_object_set (s_wired, NM_SETTING_WIRED_WAKE_ON_LAN, wol_flags, NULL); +- g_strfreev (words); ++ if ( wol_password ++ && !NM_FLAGS_HAS (wol_flags, NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC)) { ++ PARSE_WARNING ("Wake-on-LAN password not expected"); ++ ignore_wol_password = TRUE; ++ } ++ g_object_set (s_wired, ++ NM_SETTING_WIRED_WAKE_ON_LAN, wol_flags, ++ NM_SETTING_WIRED_WAKE_ON_LAN_PASSWORD, ignore_wol_password ? NULL : wol_password, ++ NULL); + } + + static NMSetting * +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 f42dbf4..42a91d3 100644 +--- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c ++++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +@@ -6122,8 +6122,7 @@ test_write_wired_static (void) + g_assert_cmpint (nm_setting_ip_config_get_route_metric (reread_s_ip4), ==, 204); + g_assert_cmpint (nm_setting_ip_config_get_route_metric (reread_s_ip6), ==, 206); + +- ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, +- "wired-static-write", "written and re-read connection weren't the same."); ++ nmtst_assert_connection_equals (connection, FALSE, reread, FALSE); + + route6file = utils_get_route6_path (testfile); + unlink (route6file); +-- +2.4.3 + +From 88b1515f3eaafa357763d827f4fbd1be302a7ec4 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Tue, 20 Oct 2015 17:39:35 +0200 +Subject: [PATCH 3/4] ifcfg-rh: remove unused variable in + parse_ethtool_option() + +(cherry picked from commit f840d9465f83ed1a5c559c2bd340068782c7d72e) +--- + src/settings/plugins/ifcfg-rh/reader.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c +index e45ad63..90706b5 100644 +--- a/src/settings/plugins/ifcfg-rh/reader.c ++++ b/src/settings/plugins/ifcfg-rh/reader.c +@@ -3509,7 +3509,6 @@ parse_ethtool_option (const char *value, NMSettingWiredWakeOnLan *out_flags, cha + gs_strfreev char **words = NULL; + const char **iter = NULL, *flag; + gboolean has_flags = FALSE; +- gboolean has_password = FALSE; + + if (!value || !value[0]) + return; +@@ -3578,14 +3577,11 @@ parse_ethtool_option (const char *value, NMSettingWiredWakeOnLan *out_flags, cha + + *out_flags = wol_flags; + } else { +- has_password = TRUE; +- + if (!iter[0]) { + PARSE_WARNING ("Wake-on-LAN password missing"); + break; + } + +- + g_clear_pointer (out_password, g_free); + if (nm_utils_hwaddr_valid (iter[0], ETH_ALEN)) + *out_password = g_strdup (iter[0]); +-- +2.4.3 + +From 446320300b87105f65285d1b04643ee7c2583010 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Tue, 20 Oct 2015 17:42:59 +0200 +Subject: [PATCH 4/4] ifcfg-rh: remove another unused variable in + parse_ethtool_option() + +(cherry picked from commit 58fc4381ff718a009fe7eb72a42a9c22e0b0a56a) +--- + src/settings/plugins/ifcfg-rh/reader.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c +index 90706b5..a1b2813 100644 +--- a/src/settings/plugins/ifcfg-rh/reader.c ++++ b/src/settings/plugins/ifcfg-rh/reader.c +@@ -3508,7 +3508,6 @@ parse_ethtool_option (const char *value, NMSettingWiredWakeOnLan *out_flags, cha + { + gs_strfreev char **words = NULL; + const char **iter = NULL, *flag; +- gboolean has_flags = FALSE; + + if (!value || !value[0]) + return; +@@ -3538,7 +3537,6 @@ parse_ethtool_option (const char *value, NMSettingWiredWakeOnLan *out_flags, cha + + if (is_wol) { + NMSettingWiredWakeOnLan wol_flags = NM_SETTING_WIRED_WAKE_ON_LAN_NONE; +- has_flags = TRUE; + + if (!iter[0]) { + PARSE_WARNING ("Wake-on-LAN options missing"); +-- +2.4.3 + diff --git a/SOURCES/0034-rh1273879-fix-software-device-unmanaged.patch b/SOURCES/0034-rh1273879-fix-software-device-unmanaged.patch new file mode 100644 index 0000000..31856e8 --- /dev/null +++ b/SOURCES/0034-rh1273879-fix-software-device-unmanaged.patch @@ -0,0 +1,160 @@ +From 4c9d7e7797274b4eeecad89811afbea424d417c0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= +Date: Wed, 21 Oct 2015 14:57:23 +0200 +Subject: [PATCH] vlan: fix unmanaged VLAN interface problem (rh #1273879) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Commit 285ee1fda2052e5b59110a323082c9423bf882e0 added NM_UNMANAGED_PLATFORM_INIT +flag marking platform uninitialized devices. The flags is set by +NM_DEVICE_PLATFORM_DEVICE property and on link changes. However, for virtual +devices, the platform device property was not set at NM device construction time +and link change event happened even before. That resulted in the device having +platform_link_initialized=FALSE and thus it was left unmanaged. + +Make the change for other software devices too. + +https://bugzilla.redhat.com/show_bug.cgi?id=1273879 +Signed-off-by: Jiří Klimeš +--- + src/devices/nm-device-bond.c | 14 ++++++++------ + src/devices/nm-device-bridge.c | 4 +++- + src/devices/nm-device-infiniband.c | 4 +++- + src/devices/nm-device-vlan.c | 4 +++- + src/devices/team/nm-device-team.c | 4 +++- + 5 files changed, 20 insertions(+), 10 deletions(-) + +diff --git a/src/devices/nm-device-bond.c b/src/devices/nm-device-bond.c +index 7f13942..afcba3b 100644 +--- a/src/devices/nm-device-bond.c ++++ b/src/devices/nm-device-bond.c +@@ -572,6 +572,7 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, + { + const char *iface = nm_connection_get_interface_name (connection); + NMPlatformError plerr; ++ const NMPlatformLink *plink; + + g_assert (iface); + +@@ -584,14 +585,15 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, + nm_platform_error_to_string (plerr)); + return NULL; + } ++ plink = nm_platform_link_get_by_ifname (NM_PLATFORM_GET, iface); + + return (NMDevice *) g_object_new (NM_TYPE_DEVICE_BOND, +- NM_DEVICE_IFACE, iface, +- NM_DEVICE_DRIVER, "bonding", +- NM_DEVICE_TYPE_DESC, "Bond", +- NM_DEVICE_DEVICE_TYPE, NM_DEVICE_TYPE_BOND, +- NM_DEVICE_IS_MASTER, TRUE, +- NULL); ++ NM_DEVICE_PLATFORM_DEVICE, plink, ++ NM_DEVICE_DRIVER, "bonding", ++ NM_DEVICE_TYPE_DESC, "Bond", ++ NM_DEVICE_DEVICE_TYPE, NM_DEVICE_TYPE_BOND, ++ NM_DEVICE_IS_MASTER, TRUE, ++ NULL); + } + + NM_DEVICE_FACTORY_DEFINE_INTERNAL (BOND, Bond, bond, +diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c +index e1cafd6..d643553 100644 +--- a/src/devices/nm-device-bridge.c ++++ b/src/devices/nm-device-bridge.c +@@ -498,6 +498,7 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, + const char *mac_address_str; + guint8 mac_address[NM_UTILS_HWADDR_LEN_MAX]; + NMPlatformError plerr; ++ const NMPlatformLink *plink; + + g_assert (iface); + +@@ -523,9 +524,10 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, + nm_platform_error_to_string (plerr)); + return NULL; + } ++ plink = nm_platform_link_get_by_ifname (NM_PLATFORM_GET, iface); + + return (NMDevice *) g_object_new (NM_TYPE_DEVICE_BRIDGE, +- NM_DEVICE_IFACE, iface, ++ NM_DEVICE_PLATFORM_DEVICE, plink, + NM_DEVICE_DRIVER, "bridge", + NM_DEVICE_TYPE_DESC, "Bridge", + NM_DEVICE_DEVICE_TYPE, NM_DEVICE_TYPE_BRIDGE, +diff --git a/src/devices/nm-device-infiniband.c b/src/devices/nm-device-infiniband.c +index 2d519f6..c1571fd 100644 +--- a/src/devices/nm-device-infiniband.c ++++ b/src/devices/nm-device-infiniband.c +@@ -327,6 +327,7 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, + int p_key, parent_ifindex; + const char *iface; + NMPlatformError plerr; ++ const NMPlatformLink *plink; + + if (!NM_IS_DEVICE_INFINIBAND (parent)) { + g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED, +@@ -352,9 +353,10 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, + nm_platform_error_to_string (plerr)); + return NULL; + } ++ plink = nm_platform_link_get_by_ifname (NM_PLATFORM_GET, iface); + + return (NMDevice *) g_object_new (NM_TYPE_DEVICE_INFINIBAND, +- NM_DEVICE_IFACE, iface, ++ NM_DEVICE_PLATFORM_DEVICE, plink, + NM_DEVICE_DRIVER, nm_device_get_driver (parent), + NM_DEVICE_TYPE_DESC, "InfiniBand", + NM_DEVICE_DEVICE_TYPE, NM_DEVICE_TYPE_INFINIBAND, +diff --git a/src/devices/nm-device-vlan.c b/src/devices/nm-device-vlan.c +index adfcef3..b330397 100644 +--- a/src/devices/nm-device-vlan.c ++++ b/src/devices/nm-device-vlan.c +@@ -698,6 +698,7 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, + NMSettingVlan *s_vlan; + gs_free char *iface = NULL; + NMPlatformError plerr; ++ const NMPlatformLink *plink; + + if (!NM_IS_DEVICE (parent)) { + g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED, +@@ -728,9 +729,10 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, + nm_platform_error_to_string (plerr)); + return NULL; + } ++ plink = nm_platform_link_get_by_ifname (NM_PLATFORM_GET, iface); + + device = (NMDevice *) g_object_new (NM_TYPE_DEVICE_VLAN, +- NM_DEVICE_IFACE, iface, ++ NM_DEVICE_PLATFORM_DEVICE, plink, + NM_DEVICE_VLAN_INT_PARENT_DEVICE, parent, + NM_DEVICE_DRIVER, "8021q", + NM_DEVICE_TYPE_DESC, "VLAN", +diff --git a/src/devices/team/nm-device-team.c b/src/devices/team/nm-device-team.c +index 09b2dd7..1950fd2 100644 +--- a/src/devices/team/nm-device-team.c ++++ b/src/devices/team/nm-device-team.c +@@ -710,6 +710,7 @@ nm_device_team_new_for_connection (NMConnection *connection, GError **error) + { + const char *iface = nm_connection_get_interface_name (connection); + NMPlatformError plerr; ++ const NMPlatformLink *plink; + + g_assert (iface); + +@@ -722,9 +723,10 @@ nm_device_team_new_for_connection (NMConnection *connection, GError **error) + nm_platform_error_to_string (plerr)); + return NULL; + } ++ plink = nm_platform_link_get_by_ifname (NM_PLATFORM_GET, iface); + + return (NMDevice *) g_object_new (NM_TYPE_DEVICE_TEAM, +- NM_DEVICE_IFACE, iface, ++ NM_DEVICE_PLATFORM_DEVICE, plink, + NM_DEVICE_DRIVER, "team", + NM_DEVICE_TYPE_DESC, "Team", + NM_DEVICE_DEVICE_TYPE, NM_DEVICE_TYPE_TEAM, +-- +2.1.0 + diff --git a/SOURCES/0035-rh1272023-vpn-cancelling.patch.patch b/SOURCES/0035-rh1272023-vpn-cancelling.patch.patch new file mode 100644 index 0000000..b1b1a19 --- /dev/null +++ b/SOURCES/0035-rh1272023-vpn-cancelling.patch.patch @@ -0,0 +1,61 @@ +From 0a95f003a9b0cad71d8fcb88562f4050881e0ace Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Tue, 20 Oct 2015 19:41:19 +0200 +Subject: [PATCH 1/2] agent-manager: cancel secrets requests on an error + +It might be that the user didn't supply the secrets in time and the dbus call +timed out. The agent should now hide the secrets dialog and we must let it know. + +https://bugzilla.redhat.com/show_bug.cgi?id=1272023 +(cherry picked from commit 5d1cac81a0bcc66b891bc38f1a2cc4b84d47f08b) +--- + src/settings/nm-agent-manager.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/settings/nm-agent-manager.c b/src/settings/nm-agent-manager.c +index 8dcda06..d59173a 100644 +--- a/src/settings/nm-agent-manager.c ++++ b/src/settings/nm-agent-manager.c +@@ -816,6 +816,9 @@ get_done_cb (NMSecretAgent *agent, + req_complete_error (parent, error); + g_error_free (error); + } else { ++ /* Tell the failed agent we're no longer interested. */ ++ nm_secret_agent_cancel_secrets (parent->current, parent->current_call_id); ++ + /* Try the next agent */ + request_next_agent (parent); + } +-- +2.4.3 + +From 24195884cd953966776074cb6d8df6bf01641845 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 22 Oct 2015 14:27:45 +0200 +Subject: [PATCH 2/2] libnm-glib,vpn-plugin: remove old connect timer when + adding new one + +If the plugin didn't succeed connecting once, don't let the old timer fire +during a subsequent connection. + +https://bugzilla.redhat.com/show_bug.cgi?id=1271973 +(cherry picked from commit 842889bc5b588d191aa2c2cbcb73452ac8971cf5) +--- + libnm-glib/nm-vpn-plugin.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libnm-glib/nm-vpn-plugin.c b/libnm-glib/nm-vpn-plugin.c +index a9c4a1f..4350e60 100644 +--- a/libnm-glib/nm-vpn-plugin.c ++++ b/libnm-glib/nm-vpn-plugin.c +@@ -426,6 +426,7 @@ connect_timer_start (NMVPNPlugin *plugin) + { + NMVPNPluginPrivate *priv = NM_VPN_PLUGIN_GET_PRIVATE (plugin); + ++ nm_clear_g_source (&priv->connect_timer); + priv->connect_timer = g_timeout_add_seconds (60, connect_timer_expired, plugin); + } + +-- +2.4.3 + diff --git a/SOURCES/0036-rh1267327-wifi-scan.patch b/SOURCES/0036-rh1267327-wifi-scan.patch new file mode 100644 index 0000000..d5ce799 --- /dev/null +++ b/SOURCES/0036-rh1267327-wifi-scan.patch @@ -0,0 +1,164 @@ +From 4b9b3d02c9e749d4e9ed99ee47ebcd7fc1b27d85 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= +Date: Wed, 30 Sep 2015 13:08:05 +0200 +Subject: [PATCH] supplicant: fix BSSs property type +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +BSSs property is an array of object paths, not strings. + +Signed-off-by: Jiří Klimeš +--- + src/supplicant-manager/nm-supplicant-interface.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c +index 08b850a..7d33db4 100644 +--- a/src/supplicant-manager/nm-supplicant-interface.c ++++ b/src/supplicant-manager/nm-supplicant-interface.c +@@ -556,7 +556,7 @@ props_changed_cb (GDBusProxy *proxy, + set_state_from_string (self, s); + } + +- if (g_variant_lookup (changed_properties, "BSSs", "^a&s", &array)) { ++ if (g_variant_lookup (changed_properties, "BSSs", "^a&o", &array)) { + iter = array; + while (*iter) + handle_new_bss (self, *iter++); +-- +2.1.0 + +From 1649fb2928cedb7512888e3856d8a742ea40916b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= +Date: Wed, 30 Sep 2015 17:05:40 +0200 +Subject: [PATCH] wifi: emit NEW_BSS on ScanDone to update APs in Wi-Fi device + (rh #1267327) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When a Wi-Fi is switched to AP mode, NMDeviceWifi forgets the AP scan list. +Later, when the device goes back to normal managed mode, the device was not +able to acquire the AP list again (for a long time), because the list is only +populated when a new BSS is signalled. And that could take very long or never +happen as the supplicant would have to lost the BSS and announce it later. + +Fix the problem by announcing known BSSs as a response to ScanDone signal. + +Testcase: +$ nmcli con add type wifi ifname wlan0 con-name my-wifi-ap autoconnect off ssid MYSSID +$ nmcli con modify my-wifi-ap wifi.mode ap ipv4.method shared +$ nmcli con up my-wifi-ap +$ nmcli con down my-wifi-ap +$ nmcli device wifi list + +https://bugzilla.redhat.com/show_bug.cgi?id=1267327 +Signed-off-by: Jiří Klimeš +--- + src/supplicant-manager/nm-supplicant-interface.c | 62 ++++++++++++++++++------ + 1 file changed, 47 insertions(+), 15 deletions(-) + +diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c +index 7d33db4..30be23a 100644 +--- a/src/supplicant-manager/nm-supplicant-interface.c ++++ b/src/supplicant-manager/nm-supplicant-interface.c +@@ -128,16 +128,36 @@ bss_props_changed_cb (GDBusProxy *proxy, + changed_properties); + } + ++static GVariant * ++_get_bss_proxy_properties (NMSupplicantInterface *self, GDBusProxy *proxy) ++{ ++ gs_strfreev char **properties = NULL; ++ GVariantBuilder builder; ++ char **iter; ++ ++ iter = properties = g_dbus_proxy_get_cached_property_names (proxy); ++ if (!iter) ++ return NULL; ++ ++ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); ++ while (*iter) { ++ GVariant *copy = g_dbus_proxy_get_cached_property (proxy, *iter); ++ ++ g_variant_builder_add (&builder, "{sv}", *iter++, copy); ++ g_variant_unref (copy); ++ } ++ ++ return g_variant_builder_end (&builder); ++} ++ ++#define BSS_PROXY_INITED "bss-proxy-inited" ++ + static void + on_bss_proxy_acquired (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data) + { + NMSupplicantInterface *self; +- NMSupplicantInterfacePrivate *priv; + gs_free_error GError *error = NULL; +- gs_strfreev char **properties = NULL; + gs_unref_variant GVariant *props = NULL; +- GVariantBuilder builder; +- char **iter; + + if (!g_async_initable_init_finish (G_ASYNC_INITABLE (proxy), result, &error)) { + if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { +@@ -149,19 +169,12 @@ on_bss_proxy_acquired (GDBusProxy *proxy, GAsyncResult *result, gpointer user_da + } + + self = NM_SUPPLICANT_INTERFACE (user_data); +- priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); +- +- g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); +- +- iter = properties = g_dbus_proxy_get_cached_property_names (proxy); +- while (iter && *iter) { +- GVariant *copy = g_dbus_proxy_get_cached_property (proxy, *iter); ++ props = _get_bss_proxy_properties (self, proxy); ++ if (!props) ++ return; + +- g_variant_builder_add (&builder, "{sv}", *iter++, copy); +- g_variant_unref (copy); +- } ++ g_object_set_data (G_OBJECT (proxy), BSS_PROXY_INITED, GUINT_TO_POINTER (TRUE)); + +- props = g_variant_builder_end (&builder); + g_signal_emit (self, signals[NEW_BSS], 0, + g_dbus_proxy_get_object_path (proxy), + g_variant_ref_sink (props)); +@@ -508,11 +521,30 @@ signal_cb (GDBusProxy *proxy, + gboolean success; + + if (MATCH_SIGNAL (signal, "ScanDone", args, G_VARIANT_TYPE ("(b)"))) { ++ GVariant *props; ++ GHashTableIter iter; ++ char *bss_path; ++ GDBusProxy *bss_proxy; ++ + /* Cache last scan completed time */ + priv->last_scan = nm_utils_get_monotonic_timestamp_s (); + + g_variant_get (args, "(b)", &success); + g_signal_emit (self, signals[SCAN_DONE], 0, success); ++ ++ /* Emit NEW_BSS so that wifi device has the APs (in case it removed them) */ ++ g_hash_table_iter_init (&iter, priv->bss_proxies); ++ while (g_hash_table_iter_next (&iter, (gpointer) &bss_path, (gpointer) &bss_proxy)) { ++ if (g_object_get_data (G_OBJECT (bss_proxy), BSS_PROXY_INITED)) { ++ props = _get_bss_proxy_properties (self, bss_proxy); ++ if (props) { ++ g_signal_emit (self, signals[NEW_BSS], 0, ++ bss_path, ++ g_variant_ref_sink (props)); ++ g_variant_unref (props); ++ } ++ } ++ } + } else if (MATCH_SIGNAL (signal, "BSSAdded", args, G_VARIANT_TYPE ("(oa{sv})"))) { + if (priv->scanning) + priv->last_scan = nm_utils_get_monotonic_timestamp_s (); +-- +2.1.0 + diff --git a/SOURCES/NetworkManager.conf b/SOURCES/NetworkManager.conf index 65e34a4..d36da0b 100644 --- a/SOURCES/NetworkManager.conf +++ b/SOURCES/NetworkManager.conf @@ -1,2 +1,18 @@ +# Configuration file for NetworkManager. +# +# See "man 5 NetworkManager.conf" for details. +# +# The directory /etc/NetworkManager/conf.d/ can contain additional configuration +# snippets. Those snippets override the settings from this main file. +# +# The files within conf.d/ directory are read in asciibetical order. +# +# If two files define the same key, the one that is read afterwards will overwrite +# the previous one. + [main] plugins=ifcfg-rh + +[logging] +#level=DEBUG +#domains=ALL diff --git a/SPECS/NetworkManager.spec b/SPECS/NetworkManager.spec index 8c0b35a..4609465 100644 --- a/SPECS/NetworkManager.spec +++ b/SPECS/NetworkManager.spec @@ -7,10 +7,10 @@ %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 16 +%define snapshot %{nil} +%define git_sha %{nil} +%define realversion 1.0.6 +%define release_version 27 %define epoch_version 1 %define obsoletes_nmver 1:1.0.0-1 @@ -71,20 +71,51 @@ Group: System Environment/Base License: GPLv2+ URL: http://www.gnome.org/projects/NetworkManager/ -Source: %{name}-%{realversion}%{snapshot}%{git_sha_version}.tar.bz2 +Source: https://download.gnome.org/sources/NetworkManager/1.0/%{name}-%{realversion}%{snapshot}%{git_sha_version}.tar.xz Source1: NetworkManager.conf Source2: 00-server.conf Source3: 10-ibft-plugin.conf Source4: README.nmcs + +# Not upstream Patch1: 0001-explain-dns1-dns2.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 -Patch8: 0008-rh1224366-fix-valid-path-assertion.patch -Patch9: 0009-rh1128581-respawn-ping-on-error.patch + +# nm-1-0 backports +Patch2: 0002-config-bugfix-parse-commandline-options-into-correct.patch +Patch3: 0003-vpn-connection-fix-unsetting-the-gateway.patch +Patch4: 0004-device-don-t-reset-NM_UNMANAGED_DEFAULT-when-platfor.patch +Patch5: 0005-workaround-config-changed-signal.patch +Patch6: 0006-fix-ignore-auto-dns-for-ipv6-rh1261428.patch +Patch7: 0007-rh1260243-iface-helper-enabled-slaac.patch +Patch8: 0008-match-cloned-mac-with-empty-one-rh1256430.patch +Patch9: 0009-rh1260584-nmcli-wol-fixes.patch +Patch10: 0010-rh1246496-retry-dhcp-assumed-connections.patch +Patch11: 0011-rh1254089-retry-generation-of-default-connection.patch +Patch12: 0012-rh1262972-ifcfg-rh-network-GATEWAY.patch +Patch13: 0013-rh1264089-nmcli-con-add-adsl.patch +Patch14: 0014-rh-1260727-crash-in-internal-dhcp-client.patch +Patch15: 0015-rh1264024-platform-perm-addr.patch +Patch16: 0016-rh1101809-increase-dad-timeout.patch +Patch17: 0017-rh1267004-vpn-mtu-for-ip-interface.patch +Patch18: 0018-rh1263959-modem-ip-families.patch +Patch19: 0019-rh1267462-fix-supplicant-interface-crash.patch +Patch20: 0020-rh1264361-platform-link-cache.patch +Patch21: 0021-rh1267672-nmtui-crash-with-secret-agent.patch +Patch22: 0022-rh1268030-vpn-plugin-timeout.patch +Patch23: 0023-rh1183444-enslave-team.patch +Patch24: 0024-rh1183444-enslave-team-fix.patch +Patch25: 0025-rh1269520-device-activation-logging.patch +Patch26: 0026-rh1260727-internal-dhcp6-lease-unref.patch +Patch27: 0027-rh1269199-assume-external-device-race.patch +Patch28: 0028-rh1264322-update-vlan-mac-address.patch +Patch29: 0029-rh1269199-assume-external-device-race-2.patch +Patch30: 0030-rh1183444-nm-clear-g-signal-handler.patch +Patch31: 0031-rh1272974-detect-s390-ctc-device.path +Patch32: 0032-rh1079353-carrier-wait.patch +Patch33: 0033-rh1270194-wol-default-ignore.patch +Patch34: 0034-rh1273879-fix-software-device-unmanaged.patch +Patch35: 0035-rh1272023-vpn-cancelling.patch.patch +Patch36: 0036-rh1267327-wifi-scan.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -146,9 +177,9 @@ BuildRequires: gtk-doc BuildRequires: libudev-devel BuildRequires: libuuid-devel BuildRequires: libgudev1-devel >= 143 -BuildRequires: vala-tools +BuildRequires: vala-tools >= 0.26.1 BuildRequires: iptables -%if 0%{?with_bluetooth} && 0%{?fedora} > 19 +%if 0%{?with_bluetooth} BuildRequires: bluez-libs-devel %endif %if 0%{?with_wimax} @@ -364,15 +395,42 @@ by nm-connection-editor and nm-applet in a non-graphical environment. %prep %setup -q -n NetworkManager-%{realversion} -%patch1 -p1 -b .0001.explain-dns1-dns2.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 -%patch8 -p1 -b .0008-rh1224366-fix-valid-path-assertion.orig -%patch9 -p1 -b .0009-rh1128581-respawn-ping-on-error.orig +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 +%patch18 -p1 +%patch19 -p1 +%patch20 -p1 +%patch21 -p1 +%patch22 -p1 +%patch23 -p1 +%patch24 -p1 +%patch25 -p1 +%patch26 -p1 +%patch27 -p1 +%patch28 -p1 +%patch29 -p1 +%patch30 -p1 +%patch31 -p1 +%patch32 -p1 +%patch33 -p1 +%patch34 -p1 +%patch35 -p1 +%patch36 -p1 %build @@ -384,7 +442,7 @@ by nm-connection-editor and nm-applet in a non-graphical environment. autoreconf -i --force autopoint --force -intltoolize --force +intltoolize --automake --copy --force %configure \ --disable-static \ --with-dhclient=yes \ @@ -487,7 +545,14 @@ ln $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/10-ifcfg-rh-routes.sh $RPM_BU %{__rm} -rf $RPM_BUILD_ROOT +%check +make check + + %post +/usr/bin/udevadm control --reload-rules || : +/usr/bin/udevadm trigger --subsystem-match=net || : + %systemd_post NetworkManager.service NetworkManager-wait-online.service NetworkManager-dispatcher.service %preun @@ -535,6 +600,8 @@ fi %if 0%{?with_nmtui} %exclude %{_mandir}/man1/nmtui* %endif +%dir %{_sysconfdir}/%{name} +%dir %{_sysconfdir}/%{name}/conf.d %config %{_sysconfdir}/%{name}/conf.d/10-ibft-plugin.conf %{_mandir}/man1/* %{_mandir}/man5/* @@ -674,11 +741,184 @@ fi %endif %changelog -* Tue Jul 14 2015 Beniamino Galvani - 1:1.0.0-16.git20150121.b4ea599c +* Mon Oct 26 2015 Thomas Haller - 1:1.0.6-27 +* build: update vala-tools build requirement (rh #1274000) + +* Sat Oct 24 2015 Jiří Klimeš - 1:1.0.6-26 +- wifi: emit NEW_BSS on ScanDone to update APs in Wi-Fi device (rh #1267327) + +* Fri Oct 23 2015 Lubomir Rintel - 1:1.0.6-25 +- vpn: cancel the secrets request on agent timeout (rh #1272023) +- vpn: cancel the connect timer when vpn reconnects (rh #1272023) + +* Wed Oct 21 2015 Jiří Klimeš - 1:1.0.6-24 +- device: fix problem in not managing software devices (rh #1273879) + +* Tue Oct 20 2015 Beniamino Galvani - 1:1.0.6-23 +- wake-on-lan: ignore by default existing settings (rh #1270194) + +* Mon Oct 19 2015 Thomas Haller - 1:1.0.6-22 +- platform: fix detection of s390 CTC device (rh #1272974) +- core: fix queuing activation while waiting for carrier (rh #1079353) + +* Mon Oct 12 2015 Thomas Haller - 1:1.0.6-21 +- core: fix invalid assertion in nm_clear_g_signal_handler() (rh #1183444) + +* Mon Oct 12 2015 Thomas Haller - 1:1.0.6-20 +- rebuild package + +* Fri Oct 9 2015 Thomas Haller - 1:1.0.6-19 +- device: fix race wrongly managing external-down device (2) (rh #1269199) + +* Fri Oct 9 2015 Beniamino Galvani - 1:1.0.6-18 +- device/vlan: update VLAN MAC address when parent's one changes + +* Thu Oct 8 2015 Thomas Haller - 1:1.0.6-17 +- dhcp6: destroy the lease when destroying a client (rh #1260727) +- device: fix race wrongly managing external-down device (rh #1269199) + +* Wed Oct 7 2015 Lubomir Rintel - 1:1.0.6-16 +- device: silence spurious errors about activation schedule (rh #1269520) + +* Tue Oct 6 2015 Thomas Haller - 1:1.0.6-15 +- core: really fix enslaving team device to bridge (rh #1183444) + +* Wed Sep 30 2015 Thomas Haller - 1:1.0.6-14 +- platform: updating link cache when moving link to other netns (rh #1264361) +- nmtui: fix possible crash during secret request (rh #1267672) +- vpn: increase the plugin inactivity quit timer (rh #1268030) +- core: fix enslaving team device to bridge (rh #1183444) + +* Tue Sep 29 2015 Lubomir Rintel - 1:1.0.6-13 +- vpn-connection: set the MTU for the VPN IP interface (rh #1267004) +- modem-broadband: update modem's supported-ip-families (rh #1263959) +- wifi: fix a crash in on_bss_proxy_acquired() (rh #1267462) + +* Fri Sep 25 2015 Dan Williams - 1:1.0.6-12 +- core: increase IPv6LL DAD timeout to 15 seconds (rh #1101809) + +* Thu Sep 24 2015 Thomas Haller - 1:1.0.6-11 +- platform: better handle devices without permanent address (rh #1264024) + +* Thu Sep 24 2015 Thomas Haller - 1:1.0.6-10 +- dhcp: fix crash in internal DHCP client (rh #1260727) + +* Tue Sep 22 2015 Jiří Klimeš - 1:1.0.6-9 +- build: fix installing language files (rh #1265117) + +* Mon Sep 21 2015 Jiří Klimeš - 1:1.0.6-8 +- nmcli: allow creating ADSL connections with 'nmcli connection add' (rh #1264089) + +* Thu Sep 17 2015 Jiří Klimeš - 1:1.0.6-7 +- ifcfg-rh: ignore GATEWAY from network file for DHCP connections (rh #1262972) + +* Wed Sep 16 2015 Beniamino Galvani - 1:1.0.6-6 +- device: retry DHCP after timeout/expiration for assumed connections (rh #1246496) +- device: retry creation of default connection after link is initialized (rh #1254089) + +* Mon Sep 14 2015 Thomas Haller - 1:1.0.6-5 +- config: add code comments to NetworkManager.conf file +- iface-helper: enabled slaac/dhcp4 based on connection setting only (rh #1260243) +- utils: avoid generation of duplicated assumed connection for veth devices (rh #1256430) +- nmcli: improve handling of wake-on-lan property (rh #1260584) + +* Wed Sep 9 2015 Thomas Haller - 1:1.0.6-4 +- config: fix config-changed signal for s390x and ppc64 archs (rh #1062301) +- device: fix handling ignore-auto-dns for IPv6 nameservers (rh #1261428) + +* Tue Sep 8 2015 Lubomir Rintel - 1:1.0.6-3 +- vpn: fix the tunelled VPN setup (rh #1238840) + +* Sat Aug 29 2015 Lubomir Rintel - 1:1.0.6-2 +- nmcli: fix argument parsing for config subcommand + +* Thu Aug 27 2015 Lubomir Rintel - 1:1.0.6-1 +- Align with the upstream 1.0.6 release: +- device: add support for configuring Wake-On-Lan (rh #1141417) +- device: don't disconnect after DHCP failure when there's static addresses (rh #1168388) +- device: provide information about metered connections (rh #1200452) +- device: fix an assert fail when cleaning up a slave connection (rh #1243371) +- team: add support for setting MTU (rh #1255927) +- config: avoid premature exit with configure-and-quit option (rh #1256772) + +* Fri Aug 21 2015 Jiří Klimeš - 1:1.0.4-10 +- supplicant: fix passing freq_list option to wpa_supplicant (rh #1254461) + +* Wed Aug 19 2015 Thomas Haller - 1:1.0.4-9 +- udev: fix call to ethtool in udev rules (rh #1247156) + +* Tue Aug 18 2015 Beniamino Galvani - 1:1.0.4-8 +- device: accept multiple addresses in a DHCPv6 lease (rh #1244293) + +* Fri Aug 14 2015 Lubomir Rintel - 1:1.0.4-7 +- device: fix a crash when unconfiguring a device (rh #1253744) + +* Wed Aug 12 2015 Jiří Klimeš - 1:1.0.4-6 +- ifcfg-rh: respect DEVTIMEOUT if link is not announced by udev yet (rh #1192633) + +* Tue Aug 4 2015 Thomas Haller - 1:1.0.4-5 +- core: avoid ethtool to autoload kernel module (rh #1247156) + +* Tue Aug 4 2015 Lubomir Rintel - 1:1.0.4-4 +- device: fix setting of a MTU (rh #1250019) + +* Wed Jul 22 2015 Lubomir Rintel - 1:1.0.4-3 +- daemon,libnm: fix handling of default routes for assumed connections (rh #1245648) + +* Fri Jul 17 2015 Jiří Klimeš - 1:1.0.4-2 +- cli: fix verifying flag-based properties (rh #1244048) + +* Tue Jul 14 2015 Lubomir Rintel - 1:1.0.4-1 +- Align with the upstream 1.0.4 release +- Fix the libreswan plugin (rh #1238840) + +* Tue Jul 14 2015 Jiří Klimeš - 1:1.0.4-0.2.git20150713.38bf2cb0 +- vpn: send firewall zone to firewalld also for VPN connections (rh #1238124) + +* Mon Jul 13 2015 Lubomir Rintel - 1:1.0.4-0.1.git20150713.38bf2cb0 +- Update to a bit newer 1.0.4 git snapshot, to fix test failures - device: restart ping process when it exits with an error (rh #1128581) -* Tue Jul 7 2015 Jiří Klimeš - 1:1.0.0-15.git20150121.b4ea599c -- device: call device_link_changed in an idle handler to fix a potential crash (rh #1224366) +* Wed Jul 1 2015 Thomas Haller - 1:1.0.3-2.git20150624.f245b49a +- config: allow rewriting resolv.conf on SIGUSR1 (rh #1062301) + +* Wed Jun 24 2015 Lubomir Rintel - 1:1.0.3-1.git20150624.f245b49a +- Update to a bit newer 1.0.4 git snapshot, to fix test failures + +* Mon Jun 22 2015 Lubomir Rintel - 1:1.0.3-1.git20150622.9c83d18d +- Update to a 1.0.4 git snapshot: +- bond: add support for setting a MTU (rh #1177860) +- core: delay initialization of the connection for devices without carrier at startup (rh #1079353) +- route-manager: ensure the routes are set up properly with multiple interface in the same subnet (rh #1164441) +- config: add support for reloading configuration (rh #1062301) +- device: disallow ipv6.method=shared connections early during activation (rh #1183015) +- device: don't save the newly added connection for a device until activation succeeds (rh #1174164) +- rdisc: prevent solicitation loop for expiring DNS information (rh #1207730) +- wifi: Indicate support of wireless radio bands (rh #1200451) +- nmcli: Fix client hang upon multiple deletion attempts of the same connection (rh #1168657) +- nmcli: Fix documentation for specifying a certificate path (rh #1182575) +- device: add support for auto-connecting slave connection when activating a master (rh #1158529) +- nmtui: Fix a crash when attempting an activation with no connection present (rh #1197203) +- nmcli: Add auto-completion and hints for valid values in enumeration properties (rh #1034126) +- core: load the the libnl library from the correct location (rh #1211859) +- config: avoid duplicate connection UUIDs (rh #1171751) +- device: enable IPv6 privacy extensions by default (rh #1187525) +- device: fix handling if DHCP hostname for configure-and-quit (rh #1201497) +- manager: reuse the device connection is active on when reactivating it (rh #1182085) +- device: reject incorrect MTU settings from an IPv6 RA (rh #1194007) +- default-route: allow preventing the connection to override externally configured default route (rh #1205405) +- manager: reduce logging for interface activation (rh #1212196) +- device: don't assume a connection for interfaces that only have an IPv6 link-local address (rh #1138426) +- device: reject hop limits that are too low (CVE-2015-2924) (rh #1217090) + +* Wed Apr 29 2015 Beniamino Galvani - 1:1.0.0-17.git20150121.b4ea599c +- dhclient: use fqdn.fqdn for server DDNS updates (rh #1212597) + +* Wed Apr 15 2015 Dan Williams - 1:1.0.0-16.git20150121.b4ea599c +- core: use dev_id when calculating interface IID (rh #1101809) + +* Fri Mar 27 2015 Dan Williams - 1:1.0.0-15.git20150121.b4ea599c +- core: respawn teamd instead of failing when it exits unexpectedly (rh #1145988) * Thu Jan 29 2015 Dan Winship - 1:1.0.0-14.git20150121.b4ea599c - dispatcher: split routing rules script into a subpackage (rh #1160013)