From d72f282e41d082ed47f6864456a5aac34652820f Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 11 May 2018 17:45:52 +0200 Subject: [PATCH] Update to 1.10.8 release --- .gitignore | 1 + 0001-fix-build-with-gcc8.patch | 334 --------------- ...device-check-rp_filter-all-rh1565529.patch | 85 ---- ...-client-continue-on-expiry-rh1575370.patch | 401 ------------------ NetworkManager.spec | 17 +- sources | 2 +- 6 files changed, 10 insertions(+), 830 deletions(-) delete mode 100644 0001-fix-build-with-gcc8.patch delete mode 100644 0002-device-check-rp_filter-all-rh1565529.patch delete mode 100644 0003-dhcp-let-client-continue-on-expiry-rh1575370.patch diff --git a/.gitignore b/.gitignore index be16015..451dcfb 100644 --- a/.gitignore +++ b/.gitignore @@ -343,3 +343,4 @@ network-manager-applet-0.8.1.tar.bz2 /NetworkManager-1.10.2.tar.xz /NetworkManager-1.10.4.tar.xz /NetworkManager-1.10.6.tar.xz +/NetworkManager-1.10.8.tar.xz diff --git a/0001-fix-build-with-gcc8.patch b/0001-fix-build-with-gcc8.patch deleted file mode 100644 index 7973356..0000000 --- a/0001-fix-build-with-gcc8.patch +++ /dev/null @@ -1,334 +0,0 @@ -From 4b25e2e9d7877986eb21319076f9aed0b62456a8 Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Wed, 7 Feb 2018 19:18:18 +0000 -Subject: [PATCH 1/5] libnm/vpn-plugin: avoid bad function pointer type casts - -This makes GCC 8.0 unhappy and it is probably right about that -- it's more -difficult to get things wrong when the function prototypes actually match. - -(cherry picked from commit 7f7207f36bc16cd5dc4550b6307efd72c9d623ee) -(cherry picked from commit 17b488cfd569bb9039dd5bb6d2c78fed7a6a3f4e) ---- - libnm-glib/nm-vpn-plugin.c | 10 +++++++++- - libnm/nm-vpn-plugin-old.c | 10 +++++++++- - libnm/nm-vpn-service-plugin.c | 10 +++++++++- - 3 files changed, 27 insertions(+), 3 deletions(-) - -diff --git a/libnm-glib/nm-vpn-plugin.c b/libnm-glib/nm-vpn-plugin.c -index 4c4c3161c..316939ca9 100644 ---- a/libnm-glib/nm-vpn-plugin.c -+++ b/libnm-glib/nm-vpn-plugin.c -@@ -686,10 +686,18 @@ impl_vpn_plugin_set_failure (NMVPNPlugin *plugin, - - /*****************************************************************************/ - -+static void -+_emit_quit (gpointer data, gpointer user_data) -+{ -+ NMVPNPlugin *plugin = data; -+ -+ nm_vpn_plugin_emit_quit (plugin); -+} -+ - static void - sigterm_handler (int signum) - { -- g_slist_foreach (active_plugins, (GFunc) nm_vpn_plugin_emit_quit, NULL); -+ g_slist_foreach (active_plugins, _emit_quit, NULL); - } - - static void -diff --git a/libnm/nm-vpn-plugin-old.c b/libnm/nm-vpn-plugin-old.c -index 2b5922b92..897f6d408 100644 ---- a/libnm/nm-vpn-plugin-old.c -+++ b/libnm/nm-vpn-plugin-old.c -@@ -904,10 +904,18 @@ impl_vpn_plugin_old_set_failure (NMVpnPluginOld *plugin, - - /*****************************************************************************/ - -+static void -+_emit_quit (gpointer data, gpointer user_data) -+{ -+ NMVpnPluginOld *plugin = data; -+ -+ nm_vpn_plugin_old_emit_quit (plugin); -+} -+ - static void - sigterm_handler (int signum) - { -- g_slist_foreach (active_plugins, (GFunc) nm_vpn_plugin_old_emit_quit, NULL); -+ g_slist_foreach (active_plugins, _emit_quit, NULL); - } - - static void -diff --git a/libnm/nm-vpn-service-plugin.c b/libnm/nm-vpn-service-plugin.c -index 0a7853965..bf2893754 100644 ---- a/libnm/nm-vpn-service-plugin.c -+++ b/libnm/nm-vpn-service-plugin.c -@@ -926,10 +926,18 @@ impl_vpn_service_plugin_set_failure (NMVpnServicePlugin *plugin, - - /*****************************************************************************/ - -+static void -+_emit_quit (gpointer data, gpointer user_data) -+{ -+ NMVpnServicePlugin *plugin = data; -+ -+ nm_vpn_service_plugin_emit_quit (plugin); -+} -+ - static void - sigterm_handler (int signum) - { -- g_slist_foreach (active_plugins, (GFunc) nm_vpn_service_plugin_emit_quit, NULL); -+ g_slist_foreach (active_plugins, _emit_quit, NULL); - } - - static void --- -2.14.3 - -From a90a1619ba82ae81f4ef038d339ff3b25ba85e8a Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Wed, 7 Feb 2018 19:23:17 +0000 -Subject: [PATCH 2/5] shared/utils/dedup-multi: make nm_dedup_multi_obj_unref() - return void - -This makes its prototype compatible with GDestroyNotify so that GCC 8.0 -won't warn. - -The return value is not used anywhere and the unref() functions typically -don't return any. - -(cherry picked from commit 411e72b3c9f95082751e9b65efd25d7f194501fc) -(cherry picked from commit 77e4af1991d41a39bdecb8b6f983ddafcecf8389) ---- - shared/nm-utils/nm-dedup-multi.c | 4 +--- - shared/nm-utils/nm-dedup-multi.h | 2 +- - 2 files changed, 2 insertions(+), 4 deletions(-) - -diff --git a/shared/nm-utils/nm-dedup-multi.c b/shared/nm-utils/nm-dedup-multi.c -index ee310a7b1..59b647eda 100644 ---- a/shared/nm-utils/nm-dedup-multi.c -+++ b/shared/nm-utils/nm-dedup-multi.c -@@ -877,7 +877,7 @@ nm_dedup_multi_index_obj_intern (NMDedupMultiIndex *self, - return obj_new; - } - --const NMDedupMultiObj * -+void - nm_dedup_multi_obj_unref (const NMDedupMultiObj *obj) - { - if (obj) { -@@ -899,8 +899,6 @@ again: - obj->klass->obj_destroy ((NMDedupMultiObj *) obj); - } - } -- -- return NULL; - } - - gboolean -diff --git a/shared/nm-utils/nm-dedup-multi.h b/shared/nm-utils/nm-dedup-multi.h -index bebfe43d3..6286d6a4c 100644 ---- a/shared/nm-utils/nm-dedup-multi.h -+++ b/shared/nm-utils/nm-dedup-multi.h -@@ -97,7 +97,7 @@ nm_dedup_multi_obj_ref (const NMDedupMultiObj *obj) - return obj; - } - --const NMDedupMultiObj *nm_dedup_multi_obj_unref (const NMDedupMultiObj *obj); -+void nm_dedup_multi_obj_unref (const NMDedupMultiObj *obj); - const NMDedupMultiObj *nm_dedup_multi_obj_clone (const NMDedupMultiObj *obj); - gboolean nm_dedup_multi_obj_needs_clone (const NMDedupMultiObj *obj); - --- -2.14.3 - -From 71747f90bf2be84cc40bce4abe76cbc7402918c3 Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Wed, 7 Feb 2018 19:27:35 +0000 -Subject: [PATCH 3/5] platform/nmp-object: make nmp_object_unref() return void - -This makes its prototype compatible with GDestroyNotify so that GCC 8.0 -won't warn. - -The return value is not used anywhere and the unref() functions typically -don't return any. - -(cherry picked from commit 3113e193c0821cb181f8a97b170144aed444fe62) -(cherry picked from commit 92b78c187acc56ad37cb47f4c1d10126e982736c) ---- - src/platform/nmp-object.h | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/src/platform/nmp-object.h b/src/platform/nmp-object.h -index e3862f2dd..e17b17b0a 100644 ---- a/src/platform/nmp-object.h -+++ b/src/platform/nmp-object.h -@@ -457,11 +457,10 @@ nmp_object_ref (const NMPObject *obj) - return (const NMPObject *) nm_dedup_multi_obj_ref ((const NMDedupMultiObj *) obj); - } - --static inline const NMPObject * -+static inline void - nmp_object_unref (const NMPObject *obj) - { - nm_dedup_multi_obj_unref ((const NMDedupMultiObj *) obj); -- return NULL; - } - - #define nm_clear_nmp_object(ptr) \ --- -2.14.3 - -From 8269cd1d5a73edf374066e1c0eeb5949a7c0881b Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Wed, 7 Feb 2018 18:08:58 +0000 -Subject: [PATCH 4/5] all: fix -Wcast-function-type warnings - -GCC 8.0's -Wcast-function-type objects casting function pointers to ones -with incompatible prototypes. Sometimes we do that on purpose though. - -Notably, the g_source_set_callback()'s func argument can point to functions -of various prototypes. Also, libnm-glib/nm-remote-connection is perhaps -just not worth reworking, that would just be a waste of time. - -A cast to void(*)(void) avoids the GCC warning, let's use it. - -(cherry picked from commit ee916a1e9ec3f06f8c88dc3d95058a6bd1561c7d) -(cherry picked from commit 42913505a3c62dac199708f3da338fa97f87d58e) ---- - clients/tui/newt/nmt-newt-form.c | 2 +- - libnm-glib/nm-remote-connection.c | 14 +++++++------- - shared/nm-utils/nm-udev-utils.c | 2 +- - 3 files changed, 9 insertions(+), 9 deletions(-) - -diff --git a/clients/tui/newt/nmt-newt-form.c b/clients/tui/newt/nmt-newt-form.c -index 835c1aba7..ccf447ead 100644 ---- a/clients/tui/newt/nmt-newt-form.c -+++ b/clients/tui/newt/nmt-newt-form.c -@@ -360,7 +360,7 @@ nmt_newt_form_real_show (NmtNewtForm *form) - keypress_source = g_io_create_watch (io, G_IO_IN); - g_source_set_can_recurse (keypress_source, TRUE); - g_source_set_callback (keypress_source, -- (GSourceFunc) nmt_newt_form_keypress_callback, -+ (GSourceFunc)(void (*) (void)) nmt_newt_form_keypress_callback, - NULL, NULL); - g_source_attach (keypress_source, NULL); - g_io_channel_unref (io); -diff --git a/libnm-glib/nm-remote-connection.c b/libnm-glib/nm-remote-connection.c -index 6dcce0ba9..820f9e5ca 100644 ---- a/libnm-glib/nm-remote-connection.c -+++ b/libnm-glib/nm-remote-connection.c -@@ -218,7 +218,7 @@ proxy_destroy_cb (DBusGProxy* proxy, gpointer user_data) { - static void - result_cb (RemoteCall *call, DBusGProxyCall *proxy_call, GError *error) - { -- NMRemoteConnectionResultFunc func = (NMRemoteConnectionResultFunc) call->callback; -+ NMRemoteConnectionResultFunc func = (NMRemoteConnectionResultFunc)(void (*) (void)) call->callback; - GError *local_error = NULL; - - if (!error) { -@@ -254,7 +254,7 @@ nm_remote_connection_commit_changes (NMRemoteConnection *self, - - priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self); - -- call = remote_call_new (self, result_cb, (GFunc) callback, user_data); -+ call = remote_call_new (self, result_cb, (GFunc)(void (*) (void)) callback, user_data); - if (!call) - return; - -@@ -294,7 +294,7 @@ nm_remote_connection_commit_changes_unsaved (NMRemoteConnection *connection, - - priv = NM_REMOTE_CONNECTION_GET_PRIVATE (connection); - -- call = remote_call_new (connection, result_cb, (GFunc) callback, user_data); -+ call = remote_call_new (connection, result_cb, (GFunc)(void (*) (void)) callback, user_data); - if (!call) - return; - -@@ -331,7 +331,7 @@ nm_remote_connection_save (NMRemoteConnection *connection, - - priv = NM_REMOTE_CONNECTION_GET_PRIVATE (connection); - -- call = remote_call_new (connection, result_cb, (GFunc) callback, user_data); -+ call = remote_call_new (connection, result_cb, (GFunc)(void (*) (void)) callback, user_data); - if (!call) - return; - -@@ -359,7 +359,7 @@ nm_remote_connection_delete (NMRemoteConnection *self, - - priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self); - -- call = remote_call_new (self, result_cb, (GFunc) callback, user_data); -+ call = remote_call_new (self, result_cb, (GFunc)(void (*) (void)) callback, user_data); - if (!call) - return; - -@@ -372,7 +372,7 @@ nm_remote_connection_delete (NMRemoteConnection *self, - static void - get_secrets_cb (RemoteCall *call, DBusGProxyCall *proxy_call, GError *error) - { -- NMRemoteConnectionGetSecretsFunc func = (NMRemoteConnectionGetSecretsFunc) call->callback; -+ NMRemoteConnectionGetSecretsFunc func = (NMRemoteConnectionGetSecretsFunc)(void (*) (void)) call->callback; - GHashTable *secrets = NULL; - GError *local_error = NULL; - -@@ -415,7 +415,7 @@ nm_remote_connection_get_secrets (NMRemoteConnection *self, - - priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self); - -- call = remote_call_new (self, get_secrets_cb, (GFunc) callback, user_data); -+ call = remote_call_new (self, get_secrets_cb, (GFunc)(void (*) (void)) callback, user_data); - if (!call) - return; - -diff --git a/shared/nm-utils/nm-udev-utils.c b/shared/nm-utils/nm-udev-utils.c -index 79d4426de..709f75904 100644 ---- a/shared/nm-utils/nm-udev-utils.c -+++ b/shared/nm-utils/nm-udev-utils.c -@@ -257,7 +257,7 @@ nm_udev_client_new (const char *const*subsystems, - channel = g_io_channel_unix_new (udev_monitor_get_fd (self->monitor)); - self->watch_source = g_io_create_watch (channel, G_IO_IN); - g_io_channel_unref (channel); -- g_source_set_callback (self->watch_source, (GSourceFunc) monitor_event, self, NULL); -+ g_source_set_callback (self->watch_source, (GSourceFunc)(void (*) (void)) monitor_event, self, NULL); - g_source_attach (self->watch_source, g_main_context_get_thread_default ()); - g_source_unref (self->watch_source); - } --- -2.14.3 - -From 247b393914626a92f11956853ea69fc3261e8ec0 Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Sat, 17 Mar 2018 07:45:10 +0100 -Subject: [PATCH 5/5] session-monitor: fix a -Wcast-function-type warning - -See-Also: ee916a1e9ec3f06f8c88dc3d95058a6bd1561c7d -(cherry picked from commit b686dd8488c3a568f41968596e22f0673c0b5c6e) -(cherry picked from commit aeaa8950494e9fb481524a13d138881195b7e297) ---- - src/nm-session-monitor.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/nm-session-monitor.c b/src/nm-session-monitor.c -index 20781bd45..e7d1d7429 100644 ---- a/src/nm-session-monitor.c -+++ b/src/nm-session-monitor.c -@@ -137,7 +137,10 @@ st_sd_init (NMSessionMonitor *monitor) - static void - st_sd_finalize (NMSessionMonitor *monitor) - { -- g_clear_pointer (&monitor->sd.monitor, sd_login_monitor_unref); -+ if (monitor->sd.monitor) { -+ sd_login_monitor_unref (monitor->sd.monitor); -+ monitor->sd.monitor = NULL; -+ } - g_source_remove (monitor->sd.watch); - } - #endif /* SESSION_TRACKING_SYSTEMD */ --- -2.14.3 - diff --git a/0002-device-check-rp_filter-all-rh1565529.patch b/0002-device-check-rp_filter-all-rh1565529.patch deleted file mode 100644 index e09c0b0..0000000 --- a/0002-device-check-rp_filter-all-rh1565529.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 528f8c33caff199f78704776b5f36ba502f85fb0 Mon Sep 17 00:00:00 2001 -From: Beniamino Galvani -Date: Tue, 10 Apr 2018 16:22:00 +0200 -Subject: [PATCH] device: look at 'all' rp_filter value too to determine actual - value - -Currently we overwrite the interface rp_filter value with 2 ("loose") -only when it is 1 ("strict") because when it is 0 ("no validation") it -is already more permissive. - -So, if the value for the interface is 0 and -net/ipv4/conf/all/rp_filter is 1 (like it happens by default on Fedora -28), we don't overwrite it; since kernel considers the maximum between -{all,$dev}/rp_filter, the effective value remains 'strict'. - -We should instead combine the two {all,$dev}/rp_filter, and if it's 1 -overwrite the value with 2. - -https://bugzilla.redhat.com/show_bug.cgi?id=1565529 -(cherry picked from commit 150cf44d501c82810e7033b7a8278713919d1d89) -(cherry picked from commit 0a1b1a4e5ca98ab9a34f384b9d4293357b56745d) ---- - src/devices/nm-device.c | 33 +++++++++++++++++++++++++-------- - 1 file changed, 25 insertions(+), 8 deletions(-) - -diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c -index b8828d14c..c3bba5206 100644 ---- a/src/devices/nm-device.c -+++ b/src/devices/nm-device.c -@@ -879,19 +879,36 @@ nm_device_ipv4_sysctl_set (NMDevice *self, const char *property, const char *val - } - - static guint32 --nm_device_ipv4_sysctl_get_uint32 (NMDevice *self, const char *property, guint32 fallback) -+nm_device_ipv4_sysctl_get_effective_uint32 (NMDevice *self, const char *property, guint32 fallback) - { - char buf[NM_UTILS_SYSCTL_IP_CONF_PATH_BUFSIZE]; -+ gint64 v, v_all; - - if (!nm_device_get_ip_ifindex (self)) - return fallback; - -- return nm_platform_sysctl_get_int_checked (nm_device_get_platform (self), -- NMP_SYSCTL_PATHID_ABSOLUTE (nm_utils_sysctl_ip_conf_path (AF_INET, buf, nm_device_get_ip_iface (self), property)), -- 10, -- 0, -- G_MAXUINT32, -- fallback); -+ v = nm_platform_sysctl_get_int_checked (nm_device_get_platform (self), -+ NMP_SYSCTL_PATHID_ABSOLUTE (nm_utils_sysctl_ip_conf_path (AF_INET, -+ buf, -+ nm_device_get_ip_iface (self), -+ property)), -+ 10, -+ 0, -+ G_MAXUINT32, -+ -1); -+ -+ v_all = nm_platform_sysctl_get_int_checked (nm_device_get_platform (self), -+ NMP_SYSCTL_PATHID_ABSOLUTE (nm_utils_sysctl_ip_conf_path (AF_INET, -+ buf, -+ "all", -+ property)), -+ 10, -+ 0, -+ G_MAXUINT32, -+ -1); -+ -+ v = NM_MAX (v, v_all); -+ return v > -1 ? (guint32) v : fallback; - } - - gboolean -@@ -2981,7 +2998,7 @@ ip4_rp_filter_update (NMDevice *self) - - if ( priv->v4_has_shadowed_routes - || nm_device_get_best_default_route (self, AF_INET)) { -- if (nm_device_ipv4_sysctl_get_uint32 (self, "rp_filter", 0) != 1) { -+ if (nm_device_ipv4_sysctl_get_effective_uint32 (self, "rp_filter", 0) != 1) { - /* Don't touch the rp_filter if it's not strict. */ - return; - } --- -2.14.3 - diff --git a/0003-dhcp-let-client-continue-on-expiry-rh1575370.patch b/0003-dhcp-let-client-continue-on-expiry-rh1575370.patch deleted file mode 100644 index 48ad8d3..0000000 --- a/0003-dhcp-let-client-continue-on-expiry-rh1575370.patch +++ /dev/null @@ -1,401 +0,0 @@ -From cc598e315eb264b44bd4b99db4f0a0f8e95111de Mon Sep 17 00:00:00 2001 -From: Beniamino Galvani -Date: Wed, 7 Mar 2018 15:27:44 +0100 -Subject: [PATCH] dhcp: handle expiry by letting the client continue for some - time - -Previously we would kill the client when the lease expired and we -restarted it 3 times at 2 minutes intervals before failing the -connection. If the client is killed after it received a NACK from the -server, it doesn't have the chance to delete the lease file and the -next time it is started it will request the same lease again. - -Also, the previous restart logic is a bit convoluted. - -Since clients already know how to deal with NACKs, let them continue -for a grace period after the expiry. When the grace period ends, we -fail the method and this can either fail the whole connection or keep -it active depending on the may-fail configuration. - -https://bugzilla.gnome.org/show_bug.cgi?id=783391 -(cherry picked from commit 17009ed91da8b3e0b10ee7e94d220be9bd3fa84c) -(cherry picked from commit 7fbbe7ebee99785e38d39c37e515a64a28edef0f) ---- - src/devices/nm-device.c | 220 ++++++++++++++++++++---------------------------- - 1 file changed, 92 insertions(+), 128 deletions(-) - -diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c -index c3bba5206..84f1e1dae 100644 ---- a/src/devices/nm-device.c -+++ b/src/devices/nm-device.c -@@ -83,9 +83,8 @@ _LOG_DECLARE_SELF (NMDevice); - - /*****************************************************************************/ - --#define DHCP_RESTART_TIMEOUT 120 --#define DHCP_NUM_TRIES_MAX 3 - #define DEFAULT_AUTOCONNECT TRUE -+#define DHCP_GRACE_PERIOD_SEC 480 - - #define CARRIER_WAIT_TIME_MS 6000 - #define CARRIER_WAIT_TIME_AFTER_MTU_MS 10000 -@@ -387,10 +386,9 @@ typedef struct _NMDevicePrivate { - NMDhcpClient * client; - gulong state_sigid; - NMDhcp4Config * config; -- guint restart_id; -- guint num_tries_left; - char * pac_url; - bool was_active; -+ guint grace_id; - } dhcp4; - - struct { -@@ -461,10 +459,9 @@ typedef struct _NMDevicePrivate { - NMIP6Config * ip6_config; - /* Event ID of the current IP6 config from DHCP */ - char * event_id; -- guint restart_id; -- guint num_tries_left; - guint needed_prefixes; - bool was_active; -+ guint grace_id; - } dhcp6; - - gboolean needs_ip6_subnet; -@@ -556,7 +553,6 @@ static void realize_start_setup (NMDevice *self, - NMUnmanFlagOp unmanaged_user_explicit); - static void _set_mtu (NMDevice *self, guint32 mtu); - static void _commit_mtu (NMDevice *self, const NMIP4Config *config); --static void dhcp_schedule_restart (NMDevice *self, int addr_family, const char *reason); - static void _cancel_activation (NMDevice *self); - - /*****************************************************************************/ -@@ -5898,7 +5894,7 @@ dhcp4_cleanup (NMDevice *self, CleanupType cleanup_type, gboolean release) - { - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - -- nm_clear_g_source (&priv->dhcp4.restart_id); -+ nm_clear_g_source (&priv->dhcp4.grace_id); - g_clear_pointer (&priv->dhcp4.pac_url, g_free); - - if (priv->dhcp4.client) { -@@ -6043,20 +6039,17 @@ dhcp4_lease_change (NMDevice *self, NMIP4Config *config) - } - - static gboolean --dhcp4_restart_cb (gpointer user_data) -+dhcp4_grace_period_expired (gpointer user_data) - { - NMDevice *self = user_data; -- NMDevicePrivate *priv; -- -- g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); - -- priv = NM_DEVICE_GET_PRIVATE (self); -- priv->dhcp4.restart_id = 0; -+ _LOGI (LOGD_DHCP4, "DHCPv4: grace period expired"); - -- if (dhcp4_start (self) == NM_ACT_STAGE_RETURN_FAILURE) -- dhcp_schedule_restart (self, AF_INET, NULL); -+ nm_device_ip_method_failed (self, AF_INET, -+ NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); -+ /* If the device didn't fail, the DHCP client will continue */ - -- return FALSE; -+ return G_SOURCE_REMOVE; - } - - static void -@@ -6064,44 +6057,48 @@ dhcp4_fail (NMDevice *self, gboolean timeout) - { - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - -- _LOGD (LOGD_DHCP4, "DHCPv4 failed: timeout %d, num tries left %u", -- timeout, priv->dhcp4.num_tries_left); -+ _LOGD (LOGD_DHCP4, "DHCPv4 failed%s", timeout ? " (timeout)" : ""); - -- dhcp4_cleanup (self, CLEANUP_TYPE_DECONFIGURE, FALSE); -- -- /* Don't fail if there are static addresses configured on -- * the device, instead retry after some time. -+ /* Keep client running if there are static addresses configured -+ * on the interface. - */ - if ( priv->ip4_state == IP_DONE - && priv->con_ip4_config -- && nm_ip4_config_get_num_addresses (priv->con_ip4_config) > 0) { -- dhcp_schedule_restart (self, AF_INET, "device has IP addresses"); -+ && nm_ip4_config_get_num_addresses (priv->con_ip4_config) > 0) -+ goto clear_config; -+ -+ /* Fail the method in case of timeout or failure during initial -+ * configuration. -+ */ -+ if ( !priv->dhcp4.was_active -+ && (timeout || priv->ip4_state == IP_CONF)) { -+ dhcp4_cleanup (self, CLEANUP_TYPE_DECONFIGURE, FALSE); -+ nm_device_activate_schedule_ip4_config_timeout (self); - return; - } - -- if ( priv->dhcp4.num_tries_left == DHCP_NUM_TRIES_MAX -- && (timeout || (priv->ip4_state == IP_CONF)) -- && !priv->dhcp4.was_active) -- nm_device_activate_schedule_ip4_config_timeout (self); -- else if ( priv->dhcp4.num_tries_left < DHCP_NUM_TRIES_MAX -- || priv->ip4_state == IP_DONE -- || priv->dhcp4.was_active) { -- /* Don't fail immediately when the lease expires but try to -- * restart DHCP for a predefined number of times. -- */ -- if (priv->dhcp4.num_tries_left) { -- priv->dhcp4.num_tries_left--; -- dhcp_schedule_restart (self, AF_INET, "lease expired"); -- } else { -- nm_device_ip_method_failed (self, AF_INET, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); -- /* We failed the ipv4 method but schedule again the retries if the ipv6 method is -- * configured, keeping the connection up. -- */ -- if (nm_device_get_state (self) != NM_DEVICE_STATE_FAILED) -- dhcp_schedule_restart (self, AF_INET, "renewal failed"); -- } -- } else -- g_warn_if_reached (); -+ /* In any other case (expired lease, assumed connection, etc.), -+ * start a grace period in which we keep the client running, -+ * hoping that it will regain a lease. -+ */ -+ if (!priv->dhcp4.grace_id) { -+ priv->dhcp4.grace_id = g_timeout_add_seconds (DHCP_GRACE_PERIOD_SEC, -+ dhcp4_grace_period_expired, -+ self); -+ _LOGI (LOGD_DHCP4, -+ "DHCPv4: %u seconds grace period started", -+ DHCP_GRACE_PERIOD_SEC); -+ goto clear_config; -+ } -+ return; -+ -+clear_config: -+ /* The previous configuration is no longer valid */ -+ if (priv->dhcp4.config) { -+ nm_exported_object_clear_and_unexport (&priv->dhcp4.config); -+ priv->dhcp4.config = nm_dhcp4_config_new (); -+ _notify (self, PROP_DHCP4_CONFIG); -+ } - } - - static void -@@ -6141,6 +6138,8 @@ dhcp4_state_changed (NMDhcpClient *client, - break; - } - -+ nm_clear_g_source (&priv->dhcp4.grace_id); -+ - /* After some failures, we have been able to renew the lease: - * update the ip state - */ -@@ -6153,7 +6152,6 @@ dhcp4_state_changed (NMDhcpClient *client, - - nm_dhcp4_config_set_options (priv->dhcp4.config, options); - _notify (self, PROP_DHCP4_CONFIG); -- priv->dhcp4.num_tries_left = DHCP_NUM_TRIES_MAX; - - if (priv->ip4_state == IP_CONF) { - connection = nm_device_get_applied_connection (self); -@@ -6524,7 +6522,6 @@ act_stage3_ip4_config_start (NMDevice *self, - } - - method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP4_CONFIG); -- priv->dhcp4.num_tries_left = DHCP_NUM_TRIES_MAX; - - /* Start IPv4 addressing based on the method requested */ - if (strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0) { -@@ -6579,7 +6576,7 @@ dhcp6_cleanup (NMDevice *self, CleanupType cleanup_type, gboolean release) - priv->dhcp6.mode = NM_NDISC_DHCP_LEVEL_NONE; - g_clear_object (&priv->dhcp6.ip6_config); - g_clear_pointer (&priv->dhcp6.event_id, g_free); -- nm_clear_g_source (&priv->dhcp6.restart_id); -+ nm_clear_g_source (&priv->dhcp6.grace_id); - - if (priv->dhcp6.client) { - nm_clear_g_signal_handler (priv->dhcp6.client, &priv->dhcp6.state_sigid); -@@ -6763,53 +6760,17 @@ dhcp6_lease_change (NMDevice *self) - } - - static gboolean --dhcp6_restart_cb (gpointer user_data) -+dhcp6_grace_period_expired (gpointer user_data) - { - NMDevice *self = user_data; -- NMDevicePrivate *priv; - -- g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); -- -- priv = NM_DEVICE_GET_PRIVATE (self); -- priv->dhcp6.restart_id = 0; -- -- if (!dhcp6_start (self, FALSE)) -- dhcp_schedule_restart (self, AF_INET6, NULL); -+ _LOGI (LOGD_DHCP6, "DHCPv6: grace period expired"); - -- return FALSE; --} -+ nm_device_ip_method_failed (self, AF_INET6, -+ NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); -+ /* If the device didn't fail, the DHCP client will continue */ - --static void --dhcp_schedule_restart (NMDevice *self, -- int addr_family, -- const char *reason) --{ -- NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); -- guint tries_left; -- char tries_str[255]; -- -- nm_assert_addr_family (addr_family); -- -- tries_left = (addr_family == AF_INET) -- ? priv->dhcp4.num_tries_left -- : priv->dhcp6.num_tries_left; -- -- _LOGI ((addr_family == AF_INET) ? LOGD_DHCP4 : LOGD_DHCP6, -- "scheduling DHCPv%c restart in %u seconds%s%s%s%s", -- nm_utils_addr_family_to_char (addr_family), -- DHCP_RESTART_TIMEOUT, -- (tries_left != DHCP_NUM_TRIES_MAX) -- ? nm_sprintf_buf (tries_str, ", %u tries left", tries_left + 1) -- : "", -- NM_PRINT_FMT_QUOTED (reason, " (reason: ", reason, ")", "")); -- -- if (addr_family == AF_INET) { -- priv->dhcp4.restart_id = g_timeout_add_seconds (DHCP_RESTART_TIMEOUT, -- dhcp4_restart_cb, self); -- } else { -- priv->dhcp6.restart_id = g_timeout_add_seconds (DHCP_RESTART_TIMEOUT, -- dhcp6_restart_cb, self); -- } -+ return G_SOURCE_REMOVE; - } - - static void -@@ -6818,51 +6779,57 @@ dhcp6_fail (NMDevice *self, gboolean timeout) - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - gboolean is_dhcp_managed; - -- _LOGD (LOGD_DHCP6, "DHCPv6 failed: timeout %d, num tries left %u", -- timeout, priv->dhcp6.num_tries_left); -+ _LOGD (LOGD_DHCP6, "DHCPv6 failed%s", timeout ? " (timeout)" : ""); - - is_dhcp_managed = (priv->dhcp6.mode == NM_NDISC_DHCP_LEVEL_MANAGED); -- dhcp6_cleanup (self, CLEANUP_TYPE_DECONFIGURE, FALSE); - -- if (is_dhcp_managed || priv->dhcp6.num_tries_left < DHCP_NUM_TRIES_MAX) { -- /* Don't fail if there are static addresses configured on -- * the device, instead retry after some time. -+ if (is_dhcp_managed) { -+ /* Keep client running if there are static addresses configured -+ * on the interface. - */ - if ( priv->ip6_state == IP_DONE - && priv->con_ip6_config -- && nm_ip6_config_get_num_addresses (priv->con_ip6_config)) { -- dhcp_schedule_restart (self, AF_INET6, "device has IP addresses"); -+ && nm_ip6_config_get_num_addresses (priv->con_ip6_config)) -+ goto clear_config; -+ -+ /* Fail the method in case of timeout or failure during initial -+ * configuration. -+ */ -+ if ( !priv->dhcp6.was_active -+ && (timeout || priv->ip6_state == IP_CONF)) { -+ dhcp6_cleanup (self, CLEANUP_TYPE_DECONFIGURE, FALSE); -+ nm_device_activate_schedule_ip6_config_timeout (self); - return; - } - -- if ( priv->dhcp6.num_tries_left == DHCP_NUM_TRIES_MAX -- && (timeout || (priv->ip6_state == IP_CONF)) -- && !priv->dhcp6.was_active) -- nm_device_activate_schedule_ip6_config_timeout (self); -- else if ( priv->dhcp6.num_tries_left < DHCP_NUM_TRIES_MAX -- || priv->ip6_state == IP_DONE -- || priv->dhcp6.was_active) { -- /* Don't fail immediately when the lease expires but try to -- * restart DHCP for a predefined number of times. -- */ -- if (priv->dhcp6.num_tries_left) { -- priv->dhcp6.num_tries_left--; -- dhcp_schedule_restart (self, AF_INET6, "lease expired"); -- } else { -- nm_device_ip_method_failed (self, AF_INET6, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); -- /* We failed the ipv6 method but schedule again the retries if the ipv4 method is -- * configured, keeping the connection up. -- */ -- if (nm_device_get_state (self) != NM_DEVICE_STATE_FAILED) -- dhcp_schedule_restart (self, AF_INET6, "renewal failed"); -- } -- } else -- g_warn_if_reached (); -+ /* In any other case (expired lease, assumed connection, etc.), -+ * start a grace period in which we keep the client running, -+ * hoping that it will regain a lease. -+ */ -+ if (!priv->dhcp6.grace_id) { -+ priv->dhcp6.grace_id = g_timeout_add_seconds (DHCP_GRACE_PERIOD_SEC, -+ dhcp6_grace_period_expired, -+ self); -+ _LOGI (LOGD_DHCP6, -+ "DHCPv6: %u seconds grace period started", -+ DHCP_GRACE_PERIOD_SEC); -+ goto clear_config; -+ } - } else { - /* not a hard failure; just live with the RA info */ -+ dhcp6_cleanup (self, CLEANUP_TYPE_DECONFIGURE, FALSE); - if (priv->ip6_state == IP_CONF) - nm_device_activate_schedule_ip6_config_result (self); - } -+ return; -+ -+clear_config: -+ /* The previous configuration is no longer valid */ -+ if (priv->dhcp6.config) { -+ nm_exported_object_clear_and_unexport (&priv->dhcp6.config); -+ priv->dhcp6.config = nm_dhcp6_config_new (); -+ _notify (self, PROP_DHCP6_CONFIG); -+ } - } - - static void -@@ -6898,6 +6865,7 @@ dhcp6_state_changed (NMDhcpClient *client, - - switch (state) { - case NM_DHCP_STATE_BOUND: -+ nm_clear_g_source (&priv->dhcp6.grace_id); - /* If the server sends multiple IPv6 addresses, we receive a state - * changed event for each of them. Use the event ID to merge IPv6 - * addresses from the same transaction into a single configuration. -@@ -6928,8 +6896,6 @@ dhcp6_state_changed (NMDhcpClient *client, - if (priv->ip6_state == IP_FAIL) - _set_ip_state (self, AF_INET6, IP_CONF); - -- priv->dhcp6.num_tries_left = DHCP_NUM_TRIES_MAX; -- - if (priv->ip6_state == IP_CONF) { - if (priv->dhcp6.ip6_config == NULL) { - nm_device_ip_method_failed (self, AF_INET6, NM_DEVICE_STATE_REASON_DHCP_FAILED); -@@ -8107,8 +8073,6 @@ act_stage3_ip6_config_start (NMDevice *self, - } - - priv->dhcp6.mode = NM_NDISC_DHCP_LEVEL_NONE; -- priv->dhcp6.num_tries_left = DHCP_NUM_TRIES_MAX; -- - method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP6_CONFIG); - - if (strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE) == 0) { --- -2.14.3 - diff --git a/NetworkManager.spec b/NetworkManager.spec index f2ebbb8..2293a90 100644 --- a/NetworkManager.spec +++ b/NetworkManager.spec @@ -7,9 +7,9 @@ %global glib2_version %(pkg-config --modversion glib-2.0 2>/dev/null || echo bad) %global epoch_version 1 -%global rpm_version 1.10.6 -%global real_version 1.10.6 -%global release_version 3 +%global rpm_version 1.10.8 +%global real_version 1.10.8 +%global release_version 1 %global snapshot %{nil} %global git_sha %{nil} @@ -90,9 +90,7 @@ Source1: NetworkManager.conf Source2: 00-server.conf Source3: 20-connectivity-fedora.conf -Patch1: 0001-fix-build-with-gcc8.patch -Patch2: 0002-device-check-rp_filter-all-rh1565529.patch -Patch3: 0003-dhcp-let-client-continue-on-expiry-rh1575370.patch +# Patch1: Requires(post): systemd Requires(preun): systemd @@ -360,9 +358,7 @@ by nm-connection-editor and nm-applet in a non-graphical environment. %prep %setup -q -n NetworkManager-%{real_version} -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 +# %patch1 -p1 %build %if %{with regen_docs} @@ -714,6 +710,9 @@ fi %endif %changelog +* Fri May 11 2018 Beniamino Galvani - 1:1.10.8-1 +- Update to 1.10.8 release + * Sun May 6 2018 Beniamino Galvani - 1:1.10.6-3 - dhcp: better handle expiry and nacks (rh #1575370) diff --git a/sources b/sources index 7b512d2..05a4b19 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (NetworkManager-1.10.6.tar.xz) = 8406ed561efff13b63dc218babdd2ad9e2816bcc829ba3ef2ce942bb5fa027640de28660381203016fa9cddb61412d3cd5102b7cbd29d0e284b5cb8d13dd8610 +SHA512 (NetworkManager-1.10.8.tar.xz) = 5253baab926ccc3cd59a71ed5ea10e9e054047b94968a04ee9f167bb4e2ac1c7b33668ca6a218eba9364ebcb00751b6b934329b1657fdbb013bb1fede7840e4c