diff options
| author | Sebastien Bacher <seb128@ubuntu.com> | 2020-01-13 16:10:30 +0100 |
|---|---|---|
| committer | Sebastien Bacher <seb128@ubuntu.com> | 2020-01-13 16:31:40 +0100 |
| commit | 5a09f7759860f4f2a9bb01471ca8099cd705bc10 (patch) | |
| tree | 3a9cffc9622d53c9196771a1c7924bceb754f118 /debian/patches | |
| parent | 25691220fd27093630cf244e219b2f4f1f4e749e (diff) | |
| parent | ca847639aab94434daed120c874e1100c3d75dcf (diff) | |
Merge remote-tracking branch 'salsa/debian/master'
Diffstat (limited to 'debian/patches')
9 files changed, 173 insertions, 71 deletions
diff --git a/debian/patches/Disable-core-with-expect.patch b/debian/patches/Disable-core-with-expect.patch index b30319f6..8c9c46ed 100644 --- a/debian/patches/Disable-core-with-expect.patch +++ b/debian/patches/Disable-core-with-expect.patch @@ -7,11 +7,11 @@ which tends to fail on ppc64el and arm64 Makefile.am | 1 - 1 file changed, 1 deletion(-) -Index: network-manager-1.18.0/Makefile.am +Index: network-manager-1.22.2/Makefile.am =================================================================== ---- network-manager-1.18.0.orig/Makefile.am -+++ network-manager-1.18.0/Makefile.am -@@ -3785,7 +3785,6 @@ +--- network-manager-1.22.2.orig/Makefile.am ++++ network-manager-1.22.2/Makefile.am +@@ -3932,7 +3932,6 @@ src_tests_ldadd = \ check_programs += \ src/tests/test-core \ @@ -19,4 +19,3 @@ Index: network-manager-1.18.0/Makefile.am src/tests/test-ip4-config \ src/tests/test-ip6-config \ src/tests/test-dcb \ - diff --git a/debian/patches/Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch b/debian/patches/Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch index 7252cb85..098e89d7 100644 --- a/debian/patches/Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch +++ b/debian/patches/Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch @@ -16,10 +16,10 @@ Closes: #742933 1 file changed, 5 insertions(+) diff --git a/src/nm-sleep-monitor.c b/src/nm-sleep-monitor.c -index c97f6f7..5ea0a64 100644 +index c16dc07..cb2ca21 100644 --- a/src/nm-sleep-monitor.c +++ b/src/nm-sleep-monitor.c -@@ -22,6 +22,7 @@ +@@ -10,6 +10,7 @@ #include <sys/stat.h> #include <gio/gunixfdlist.h> @@ -27,7 +27,7 @@ index c97f6f7..5ea0a64 100644 #include "nm-core-internal.h" #include "NetworkManagerUtils.h" -@@ -341,6 +342,10 @@ on_proxy_acquired (GObject *object, +@@ -329,6 +330,10 @@ on_proxy_acquired (GObject *object, static void nm_sleep_monitor_init (NMSleepMonitor *self) { diff --git a/debian/patches/Force-online-state-with-unmanaged-devices.patch b/debian/patches/Force-online-state-with-unmanaged-devices.patch index 78f89c1a..40c5217a 100644 --- a/debian/patches/Force-online-state-with-unmanaged-devices.patch +++ b/debian/patches/Force-online-state-with-unmanaged-devices.patch @@ -12,10 +12,10 @@ Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=512286 1 file changed, 115 insertions(+) diff --git a/src/nm-manager.c b/src/nm-manager.c -index d112fcf..267a5a8 100644 +index 3696c78..abd71c4 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c -@@ -60,6 +60,8 @@ +@@ -50,6 +50,8 @@ #include "nm-dispatcher.h" #include "NetworkManagerUtils.h" @@ -24,7 +24,7 @@ index d112fcf..267a5a8 100644 /*****************************************************************************/ typedef struct { -@@ -198,6 +200,10 @@ typedef struct { +@@ -188,6 +190,10 @@ typedef struct { GFileMonitor *fw_monitor; guint fw_changed_id; @@ -35,7 +35,7 @@ index d112fcf..267a5a8 100644 guint timestamp_update_id; guint devices_inited_id; -@@ -1436,6 +1442,27 @@ find_best_device_state (NMManager *manager) +@@ -1426,6 +1432,27 @@ find_best_device_state (NMManager *manager) return best_state; } @@ -63,7 +63,7 @@ index d112fcf..267a5a8 100644 static void nm_manager_update_metered (NMManager *self) { -@@ -1482,6 +1509,9 @@ nm_manager_update_state (NMManager *self) +@@ -1472,6 +1499,9 @@ nm_manager_update_state (NMManager *self) else new_state = find_best_device_state (self); @@ -73,7 +73,7 @@ index d112fcf..267a5a8 100644 if ( new_state >= NM_STATE_CONNECTED_LOCAL && priv->connectivity_state == NM_CONNECTIVITY_FULL) { new_state = NM_STATE_CONNECTED_GLOBAL; -@@ -6491,6 +6521,62 @@ impl_manager_check_connectivity (NMDBusObject *obj, +@@ -6536,6 +6566,62 @@ impl_manager_check_connectivity (NMDBusObject *obj, nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL, TRUE); } @@ -136,7 +136,7 @@ index d112fcf..267a5a8 100644 static void start_factory (NMDeviceFactory *factory, gpointer user_data) { -@@ -6664,6 +6750,9 @@ nm_manager_start (NMManager *self, GError **error) +@@ -6709,6 +6795,9 @@ nm_manager_start (NMManager *self, GError **error) nm_clear_g_source (&priv->devices_inited_id); priv->devices_inited_id = g_idle_add_full (G_PRIORITY_LOW + 10, devices_inited_cb, self, NULL); @@ -146,7 +146,7 @@ index d112fcf..267a5a8 100644 return TRUE; } -@@ -7512,6 +7601,22 @@ nm_manager_init (NMManager *self) +@@ -7557,6 +7646,22 @@ nm_manager_init (NMManager *self) KERNEL_FIRMWARE_DIR); } @@ -169,7 +169,7 @@ index d112fcf..267a5a8 100644 /* Update timestamps in active connections */ priv->timestamp_update_id = g_timeout_add_seconds (300, (GSourceFunc) periodic_update_active_connection_timestamps, self); -@@ -7794,6 +7899,16 @@ dispose (GObject *object) +@@ -7839,6 +7944,16 @@ dispose (GObject *object) g_clear_object (&priv->fw_monitor); } diff --git a/debian/patches/Update-dnsmasq-parameters.patch b/debian/patches/Update-dnsmasq-parameters.patch index d22d0a28..9787e983 100644 --- a/debian/patches/Update-dnsmasq-parameters.patch +++ b/debian/patches/Update-dnsmasq-parameters.patch @@ -10,26 +10,26 @@ See also: https://blueprints.launchpad.net/ubuntu/+spec/foundations-p-dns-resolv src/dns/nm-dns-manager.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) -Index: network-manager-1.20.0/src/dns/nm-dns-dnsmasq.c +Index: network-manager-1.22.2/src/dns/nm-dns-dnsmasq.c =================================================================== ---- network-manager-1.20.0.orig/src/dns/nm-dns-dnsmasq.c -+++ network-manager-1.20.0/src/dns/nm-dns-dnsmasq.c -@@ -336,8 +336,8 @@ start_dnsmasq (NMDnsDnsmasq *self) - argv[idx++] = "--no-hosts"; /* don't use /etc/hosts to resolve */ - argv[idx++] = "--bind-interfaces"; - argv[idx++] = "--pid-file=" PIDFILE; -- argv[idx++] = "--listen-address=127.0.0.1"; /* Should work for both 4 and 6 */ -- argv[idx++] = "--cache-size=400"; -+ argv[idx++] = "--listen-address=127.0.1.1"; /* Should work for both 4 and 6 */ -+ argv[idx++] = "--cache-size=0"; - argv[idx++] = "--clear-on-reload"; /* clear cache when dns server changes */ - argv[idx++] = "--conf-file=/dev/null"; /* avoid loading /etc/dnsmasq.conf */ - argv[idx++] = "--proxy-dnssec"; /* Allow DNSSEC to pass through */ -Index: network-manager-1.20.0/src/dns/nm-dns-manager.c +--- network-manager-1.22.2.orig/src/dns/nm-dns-dnsmasq.c ++++ network-manager-1.22.2/src/dns/nm-dns-dnsmasq.c +@@ -494,8 +494,8 @@ _gl_pid_spawn_next_step (void) + argv[argv_idx++] = "--no-hosts"; /* don't use /etc/hosts to resolve */ + argv[argv_idx++] = "--bind-interfaces"; + argv[argv_idx++] = "--pid-file=" PIDFILE; +- argv[argv_idx++] = "--listen-address=127.0.0.1"; /* Should work for both 4 and 6 */ +- argv[argv_idx++] = "--cache-size=400"; ++ argv[argv_idx++] = "--listen-address=127.0.1.1"; /* Should work for both 4 and 6 */ ++ argv[argv_idx++] = "--cache-size=0"; + argv[argv_idx++] = "--clear-on-reload"; /* clear cache when dns server changes */ + argv[argv_idx++] = "--conf-file=/dev/null"; /* avoid loading /etc/dnsmasq.conf */ + argv[argv_idx++] = "--proxy-dnssec"; /* Allow DNSSEC to pass through */ +Index: network-manager-1.22.2/src/dns/nm-dns-manager.c =================================================================== ---- network-manager-1.20.0.orig/src/dns/nm-dns-manager.c -+++ network-manager-1.20.0/src/dns/nm-dns-manager.c -@@ -1485,12 +1485,12 @@ update_dns (NMDnsManager *self, +--- network-manager-1.22.2.orig/src/dns/nm-dns-manager.c ++++ network-manager-1.22.2/src/dns/nm-dns-manager.c +@@ -1469,12 +1469,12 @@ update_dns (NMDnsManager *self, NM_CAST_STRV_CC (nameservers), NM_CAST_STRV_CC (options)); @@ -44,7 +44,7 @@ Index: network-manager-1.20.0/src/dns/nm-dns-manager.c if (NM_IS_DNS_SYSTEMD_RESOLVED (priv->plugin)) { /* systemd-resolved uses a different link-local address */ -@@ -1832,7 +1832,7 @@ nm_dns_manager_stop (NMDnsManager *self) +@@ -1757,7 +1757,7 @@ nm_dns_manager_stop (NMDnsManager *self) _LOGT ("stopping..."); /* If we're quitting, leave a valid resolv.conf in place, not one diff --git a/debian/patches/dhcp-nettools-handle-retracted-event-as-expired.patch b/debian/patches/dhcp-nettools-handle-retracted-event-as-expired.patch new file mode 100644 index 00000000..23378ce5 --- /dev/null +++ b/debian/patches/dhcp-nettools-handle-retracted-event-as-expired.patch @@ -0,0 +1,36 @@ +From: Beniamino Galvani <bgalvani@redhat.com> +Date: Tue, 7 Jan 2020 12:03:21 +0100 +Subject: dhcp: nettools: handle 'retracted' event as 'expired' + +The 'retracted' event is emitted when the client receives a NAK in the +rebooting, requesting, renewing or rebinding state, while 'expired' +means that the client wasn't able to renew the lease before expiry. + +In both cases the old lease is no longer valid and n-dhcp4 keep trying +to get a lease, so the two events should be handlded in the same way. + +Note that the systemd client doesn't have a 'retracted' event and +considers all NAKs as 'expired' events. + +(cherry picked from commit 2523000b36b113fd7b94ae6b7178f6fd33908ef9) +(cherry picked from commit 92b382e2f85b0870b553358cec0209a0a0e3ce31) +--- + src/dhcp/nm-dhcp-nettools.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/dhcp/nm-dhcp-nettools.c b/src/dhcp/nm-dhcp-nettools.c +index 1f76c64..b4c0a45 100644 +--- a/src/dhcp/nm-dhcp-nettools.c ++++ b/src/dhcp/nm-dhcp-nettools.c +@@ -1028,10 +1028,10 @@ dhcp4_event_handle (NMDhcpNettools *self, + _LOGW ("selecting lease failed: %d", r); + } + break; ++ case N_DHCP4_CLIENT_EVENT_RETRACTED: + case N_DHCP4_CLIENT_EVENT_EXPIRED: + nm_dhcp_client_set_state (NM_DHCP_CLIENT (self), NM_DHCP_STATE_EXPIRE, NULL, NULL); + break; +- case N_DHCP4_CLIENT_EVENT_RETRACTED: + case N_DHCP4_CLIENT_EVENT_CANCELLED: + nm_dhcp_client_set_state (NM_DHCP_CLIENT (self), NM_DHCP_STATE_FAIL, NULL, NULL); + break; diff --git a/debian/patches/libnm-Check-self-still-NMManager-or-not.patch b/debian/patches/libnm-Check-self-still-NMManager-or-not.patch deleted file mode 100644 index 061a8a7f..00000000 --- a/debian/patches/libnm-Check-self-still-NMManager-or-not.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: "Shih-Yuan Lee (FourDollars)" <sylee@canonical.com> -Date: Tue, 17 May 2016 17:26:06 +0800 -Subject: libnm: Check self still NMManager or not - -Return if self is not NMManager or it will crash. ---- - libnm/nm-manager.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -Index: network-manager-1.20.0/libnm/nm-manager.c -=================================================================== ---- network-manager-1.20.0.orig/libnm/nm-manager.c -+++ network-manager-1.20.0/libnm/nm-manager.c -@@ -967,7 +967,7 @@ find_active_connection_by_path (NMManage - static void - recheck_pending_activations (NMManager *self) - { -- NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); -+ NMManagerPrivate *priv; - CList *iter, *safe; - NMActiveConnection *candidate; - const GPtrArray *devices; -@@ -977,6 +977,10 @@ recheck_pending_activations (NMManager * - - object_manager = _nm_object_get_dbus_object_manager (NM_OBJECT (self)); - -+ g_return_if_fail (NM_IS_MANAGER (self)); -+ -+ priv = NM_MANAGER_GET_PRIVATE (self); -+ - /* For each pending activation, look for an active connection that has the - * pending activation's object path, where the active connection and its - * device have both updated their properties to point to each other, and diff --git a/debian/patches/n-dhcp4-allow-calling-listen-on-already-listening-connect.patch b/debian/patches/n-dhcp4-allow-calling-listen-on-already-listening-connect.patch new file mode 100644 index 00000000..d682210b --- /dev/null +++ b/debian/patches/n-dhcp4-allow-calling-listen-on-already-listening-connect.patch @@ -0,0 +1,29 @@ +From: Beniamino Galvani <bgalvani@redhat.com> +Date: Tue, 7 Jan 2020 12:01:39 +0100 +Subject: n-dhcp4: allow calling listen() on already listening connection + +When the client enters the INIT state, it calls listen() on the +connection connection to create the packet socket. However, if the +client is coming from the REBOOTING state after a NAK, the connection +is already in the listening state; do nothing in such case. + +(cherry picked from commit 4bcdc3c1ebe3e2e8a967ff067ecb2a8cbfc2f6ab) +(cherry picked from commit 2e1d3ae572a753f0181760d9fa41558d33849b09) +--- + shared/n-dhcp4/src/n-dhcp4-c-connection.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/shared/n-dhcp4/src/n-dhcp4-c-connection.c b/shared/n-dhcp4/src/n-dhcp4-c-connection.c +index e51a3e3..f3ae44e 100644 +--- a/shared/n-dhcp4/src/n-dhcp4-c-connection.c ++++ b/shared/n-dhcp4/src/n-dhcp4-c-connection.c +@@ -139,6 +139,9 @@ int n_dhcp4_c_connection_listen(NDhcp4CConnection *connection) { + _c_cleanup_(c_closep) int fd_packet = -1; + int r; + ++ if (connection->state == N_DHCP4_C_CONNECTION_STATE_PACKET) ++ return 0; ++ + c_assert(connection->state == N_DHCP4_C_CONNECTION_STATE_INIT || + connection->state == N_DHCP4_C_CONNECTION_STATE_DRAINING || + connection->state == N_DHCP4_C_CONNECTION_STATE_UDP); diff --git a/debian/patches/n-dhcp4-restart-the-transaction-after-a-NAK.patch b/debian/patches/n-dhcp4-restart-the-transaction-after-a-NAK.patch new file mode 100644 index 00000000..d245597f --- /dev/null +++ b/debian/patches/n-dhcp4-restart-the-transaction-after-a-NAK.patch @@ -0,0 +1,70 @@ +From: Beniamino Galvani <bgalvani@redhat.com> +Date: Tue, 7 Jan 2020 12:02:55 +0100 +Subject: n-dhcp4: restart the transaction after a NAK + +It is not enough to set the INIT state after a NAK; a timeout +(ns_deferred) must be set so that it is added to the event fd. The +client retries immediately the first time, so that in the successful +case it gets an address quickly. To avoid flooding the network in case +of servers always replying with NAKs, next attempts are done with +intervals from 2 seconds to 5 minutes using exponential backoff. See +also systemd commit [1]. + +[1] https://github.com/systemd/systemd/commit/1d1a3e0afb85478cda43670b8ed92a6db6c83f3e + +https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/325 +(cherry picked from commit 218782a9a3c326f5c8cc3ea40dc0cd039060b188) +(cherry picked from commit ae5b9343d2e52917546f228b7a4d3c7fc4fa98ec) +--- + shared/n-dhcp4/src/n-dhcp4-c-probe.c | 10 ++++++---- + shared/n-dhcp4/src/n-dhcp4-private.h | 1 + + 2 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/shared/n-dhcp4/src/n-dhcp4-c-probe.c b/shared/n-dhcp4/src/n-dhcp4-c-probe.c +index 4fb7d38..82a089e 100644 +--- a/shared/n-dhcp4/src/n-dhcp4-c-probe.c ++++ b/shared/n-dhcp4/src/n-dhcp4-c-probe.c +@@ -946,7 +946,7 @@ static int n_dhcp4_client_probe_transition_ack(NDhcp4ClientProbe *probe, NDhcp4I + n_dhcp4_client_lease_unref(probe->current_lease); + probe->current_lease = n_dhcp4_client_lease_ref(lease); + probe->state = N_DHCP4_CLIENT_PROBE_STATE_BOUND; +- ++ probe->ns_nak_restart_delay = 0; + break; + + case N_DHCP4_CLIENT_PROBE_STATE_REQUESTING: +@@ -969,7 +969,7 @@ static int n_dhcp4_client_probe_transition_ack(NDhcp4ClientProbe *probe, NDhcp4I + node->event.granted.lease = n_dhcp4_client_lease_ref(lease); + probe->current_lease = n_dhcp4_client_lease_ref(lease); + probe->state = N_DHCP4_CLIENT_PROBE_STATE_GRANTED; +- ++ probe->ns_nak_restart_delay = 0; + break; + + case N_DHCP4_CLIENT_PROBE_STATE_INIT: +@@ -1004,9 +1004,11 @@ static int n_dhcp4_client_probe_transition_nak(NDhcp4ClientProbe *probe) { + return r; + + probe->state = N_DHCP4_CLIENT_PROBE_STATE_INIT; +- ++ probe->ns_deferred = n_dhcp4_gettime(CLOCK_BOOTTIME) + probe->ns_nak_restart_delay; ++ probe->ns_nak_restart_delay = c_clamp(probe->ns_nak_restart_delay * 2, ++ UINT64_C(1000000000 * 2), ++ UINT64_C(1000000000 * 300)); + break; +- + case N_DHCP4_CLIENT_PROBE_STATE_SELECTING: + case N_DHCP4_CLIENT_PROBE_STATE_INIT_REBOOT: + case N_DHCP4_CLIENT_PROBE_STATE_INIT: +diff --git a/shared/n-dhcp4/src/n-dhcp4-private.h b/shared/n-dhcp4/src/n-dhcp4-private.h +index fcfb0f3..c092ae8 100644 +--- a/shared/n-dhcp4/src/n-dhcp4-private.h ++++ b/shared/n-dhcp4/src/n-dhcp4-private.h +@@ -352,6 +352,7 @@ struct NDhcp4ClientProbe { + unsigned int state; /* current probe state */ + uint64_t ns_deferred; /* timeout for deferred action */ + uint64_t ns_reinit; ++ uint64_t ns_nak_restart_delay; /* restart delay after a nak */ + NDhcp4ClientLease *current_lease; /* current lease */ + + NDhcp4CConnection connection; /* client connection wrapper */ diff --git a/debian/patches/series b/debian/patches/series index 0a749301..91470b4d 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,9 +1,10 @@ Force-online-state-with-unmanaged-devices.patch Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch +n-dhcp4-allow-calling-listen-on-already-listening-connect.patch +n-dhcp4-restart-the-transaction-after-a-NAK.patch +dhcp-nettools-handle-retracted-event-as-expired.patch # Ubuntu patches Provide-access-to-some-of-NM-s-interfaces-to-whoopsie.patch Update-dnsmasq-parameters.patch Disable-core-with-expect.patch -libnm-Check-self-still-NMManager-or-not.patch - |