Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package NetworkManager for openSUSE:Factory 
checked in at 2021-04-14 10:09:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/NetworkManager (Old)
 and      /work/SRC/openSUSE:Factory/.NetworkManager.new.2401 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "NetworkManager"

Wed Apr 14 10:09:33 2021 rev:222 rq:884652 version:1.30.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/NetworkManager/NetworkManager.changes    
2021-02-25 18:26:27.786141469 +0100
+++ /work/SRC/openSUSE:Factory/.NetworkManager.new.2401/NetworkManager.changes  
2021-04-14 10:09:36.661355089 +0200
@@ -1,0 +2,14 @@
+Fri Apr  9 06:11:21 UTC 2021 - Jonathan Kang <songchuan.k...@suse.com>
+
+- Add nm-dhcp-use-valid-lease-on-timeout.patch: Support valid lease
+  file on dhcp timeout(glfd#NetworkManager/NetworkManager!811,
+  bsc#1183202).
+
+-------------------------------------------------------------------
+Thu Mar 25 07:54:02 UTC 2021 - Jonathan Kang <songchuan.k...@suse.com>
+
+- Add NM-restore-MAC-on-release-only-when-cloned.patch: bond:
+  restore MAC on release only when there is a cloned MAC address
+  (glfo#NetworkManager/NetworkManager!775, bsc#1183967).
+
+-------------------------------------------------------------------

New:
----
  NM-restore-MAC-on-release-only-when-cloned.patch
  nm-dhcp-use-valid-lease-on-timeout.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ NetworkManager.spec ++++++
--- /var/tmp/diff_new_pack.MGyFjm/_old  2021-04-14 10:09:37.317356196 +0200
+++ /var/tmp/diff_new_pack.MGyFjm/_new  2021-04-14 10:09:37.317356196 +0200
@@ -51,6 +51,10 @@
 Patch6:         0001-Coerce-connectivity-LIMITED-to-NONE-when-device-is-d.patch
 # PATCH-FIX-OPENSUSE nm-add-CAP_SYS_ADMIN-permission.patch bsc#1129587 
sck...@suse.com -- Add CAP_SYS_ADMIN which netconfig needs to call setdomainname
 Patch7:         nm-add-CAP_SYS_ADMIN-permission.patch
+# PATCH-FIX-UPSTREAM NM-restore-MAC-on-release-only-when-cloned.patch 
glfo#NetworkManager/NetworkManager!775, bsc#1183967 sck...@suse.com -- bond: 
restore MAC on release only when there is a cloned MAC address
+Patch8:         NM-restore-MAC-on-release-only-when-cloned.patch
+# PATCH-FIX-UPSTREAM nm-dhcp-use-valid-lease-on-timeout.patch 
glfd#NetworkManager/NetworkManager!811, bsc#1183202 sck...@suse.com Support 
valid lease file on dhcp timeout
+Patch9:         nm-dhcp-use-valid-lease-on-timeout.patch
 
 BuildRequires:  dnsmasq
 BuildRequires:  fdupes
@@ -189,6 +193,8 @@
 %patch5 -p1
 %patch6 -p1
 %patch7 -p1
+%patch8 -p1
+%patch9 -p1
 
 %build
 NOCONFIGURE=1 ./autogen.sh

++++++ NM-restore-MAC-on-release-only-when-cloned.patch ++++++
>From 190fd9aa9f3fbf5705c2b80b9fc64c89d22b7593 Mon Sep 17 00:00:00 2001
From: Beniamino Galvani <bgalv...@redhat.com>
Date: Sat, 6 Mar 2021 11:35:12 +0100
Subject: [PATCH] bond: restore MAC on release only when there is a cloned MAC
 address

Currently we unconditionally reset the MAC to the previous value after
releasing ports. This has some disadvantages:

 - by default, after the last port is removed the bond will have one
   of the previous port's address, which could conflict with the port;

 - in some cases, changing the bond MAC is not possible. For example
   when the bond is active-backup and has fail_over_mac=1|2. In such
   case the netlink call succeeds, but the address doesn't
   change; then NM would keep waiting for some time.

Don't try to restore the MAC unless the bond connection has a cloned
MAC set.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/775
---
 src/core/devices/nm-device-bond.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/core/devices/nm-device-bond.c 
b/src/core/devices/nm-device-bond.c
index 878d3e9e0c..29d3abb42a 100644
--- a/src/core/devices/nm-device-bond.c
+++ b/src/core/devices/nm-device-bond.c
@@ -444,9 +444,10 @@ release_slave(NMDevice *device, NMDevice *slave, gboolean 
configure)
         _LOGD(LOGD_BOND, "bond slave %s is already released", 
nm_device_get_ip_iface(slave));
 
     if (configure) {
-        /* When the last slave is released the bond MAC will be set to a random
-         * value by kernel; remember the current one and restore it afterwards.
-         */
+        NMConnection *  applied;
+        NMSettingWired *s_wired;
+        const char *    cloned_mac;
+
         address = g_strdup(nm_device_get_hw_address(device));
 
         if (ifindex_slave > 0) {
@@ -461,9 +462,16 @@ release_slave(NMDevice *device, NMDevice *slave, gboolean 
configure)
             }
         }
 
-        nm_platform_process_events(nm_device_get_platform(device));
-        if (nm_device_update_hw_address(device))
-            nm_device_hw_addr_set(device, address, "restore", FALSE);
+        if ((applied = nm_device_get_applied_connection(device))
+            && ((s_wired = nm_connection_get_setting_wired(applied)))
+            && ((cloned_mac = 
nm_setting_wired_get_cloned_mac_address(s_wired)))) {
+            /* When the last slave is released the bond MAC will be set to a 
random
+             * value by kernel; if we have set a cloned-mac-address, we need to
+             * restore it to the previous value. */
+            nm_platform_process_events(nm_device_get_platform(device));
+            if (nm_device_update_hw_address(device))
+                nm_device_hw_addr_set(device, address, "restore", FALSE);
+        }
 
         /* Kernel bonding code "closes" the slave when releasing it, (which 
clears
          * IFF_UP), so we must bring it back up here to ensure carrier changes 
and
-- 
2.30.2

++++++ nm-dhcp-use-valid-lease-on-timeout.patch ++++++
>From c308fc8823f238e07ff914bb635f9e729b84c716 Mon Sep 17 00:00:00 2001
From: Jonathan Kang <jonathank...@gnome.org>
Date: Thu, 8 Apr 2021 10:21:49 +0800
Subject: [PATCH] dhcp-client: Support using valid lease configuration on
 timeout

dhclient checks lease file on timeout. If they are still valid, the ip
configs will be used. While currently NetworkManager directly fails
the dhcp configuration once timeout is reached.

Fix that by using ip configs found in the valid lease file on timeout,
when dhclient is the dhcp backend.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/682
---
 src/core/devices/nm-device.c      |  7 ++-----
 src/core/dhcp/nm-dhcp-client.c    | 13 ++++++++-----
 src/core/dhcp/nm-dhcp-dhcpcanon.c |  1 +
 src/core/dhcp/nm-dhcp-dhcpcd.c    |  1 +
 4 files changed, 12 insertions(+), 10 deletions(-)

Index: NetworkManager-1.30.0/src/core/devices/nm-device.c
===================================================================
--- NetworkManager-1.30.0.orig/src/core/devices/nm-device.c
+++ NetworkManager-1.30.0/src/core/devices/nm-device.c
@@ -9314,6 +9314,7 @@ dhcp4_state_changed(NMDhcpClient *client
     switch (state) {
     case NM_DHCP_STATE_BOUND:
     case NM_DHCP_STATE_EXTENDED:
+    case NM_DHCP_STATE_TIMEOUT:
         if (!ip4_config) {
             _LOGW(LOGD_DHCP4, "failed to get IPv4 config in response to DHCP 
event.");
             dhcp4_fail(self, state);
@@ -9360,9 +9361,6 @@ dhcp4_state_changed(NMDhcpClient *client
                 dhcp4_fail(self, state);
         }
         break;
-    case NM_DHCP_STATE_TIMEOUT:
-        dhcp4_fail(self, state);
-        break;
     case NM_DHCP_STATE_EXPIRE:
         /* Ignore expiry before we even have a lease (NAK, old lease, etc) */
         if (priv->ip_state_4 == NM_DEVICE_IP_STATE_CONF)
Index: NetworkManager-1.30.0/src/core/dhcp/nm-dhcp-client.c
===================================================================
--- NetworkManager-1.30.0.orig/src/core/dhcp/nm-dhcp-client.c
+++ NetworkManager-1.30.0/src/core/dhcp/nm-dhcp-client.c
@@ -19,6 +19,7 @@
 
 #include "NetworkManagerUtils.h"
 #include "nm-utils.h"
+#include "nm-dhcp-manager.h"
 #include "nm-dhcp-utils.h"
 #include "nm-dhcp-options.h"
 #include "platform/nm-platform.h"
@@ -443,14 +444,14 @@ nm_dhcp_client_set_state(NMDhcpClient *s
     if (NM_IN_SET(new_state, NM_DHCP_STATE_BOUND, NM_DHCP_STATE_EXTENDED)) {
         g_return_if_fail(NM_IS_IP_CONFIG_ADDR_FAMILY(ip_config, 
priv->addr_family));
         g_return_if_fail(options);
-    } else {
+    } else if (!NM_IN_SET (new_state, NM_DHCP_STATE_TIMEOUT)) {
         g_return_if_fail(!ip_config);
         g_return_if_fail(!options);
     }
 
     if (new_state >= NM_DHCP_STATE_BOUND)
         timeout_cleanup(self);
-    if (new_state >= NM_DHCP_STATE_TIMEOUT)
+    if (new_state >= NM_DHCP_STATE_TIMEOUT && !ip_config)
         watch_cleanup(self);
 
     /* The client may send same-state transitions for RENEW/REBIND events and
@@ -557,8 +558,6 @@ nm_dhcp_client_watch_child(NMDhcpClient
     g_return_if_fail(priv->pid == -1);
     priv->pid = pid;
 
-    nm_dhcp_client_start_timeout(self);
-
     g_return_if_fail(priv->watch_id == 0);
     priv->watch_id = g_child_watch_add(pid, daemon_watch_cb, self);
 }
@@ -905,7 +904,9 @@ nm_dhcp_client_handle_event(gpointer
     if (new_state == NM_DHCP_STATE_NOOP)
         return TRUE;
 
-    if (NM_IN_SET(new_state, NM_DHCP_STATE_BOUND, NM_DHCP_STATE_EXTENDED)) {
+    if (NM_IN_SET(new_state, NM_DHCP_STATE_BOUND, NM_DHCP_STATE_EXTENDED)
+        || (NM_IN_SET (new_state, NM_DHCP_STATE_TIMEOUT)
+           && g_strcmp0 (nm_dhcp_manager_get_config (nm_dhcp_manager_get ()), 
"dhclient") == 0)) {
         GVariantIter iter;
         const char * name;
         GVariant *   value;
Index: NetworkManager-1.30.0/src/core/dhcp/nm-dhcp-dhcpcanon.c
===================================================================
--- NetworkManager-1.30.0.orig/src/core/dhcp/nm-dhcp-dhcpcanon.c
+++ NetworkManager-1.30.0/src/core/dhcp/nm-dhcp-dhcpcanon.c
@@ -156,6 +156,7 @@ dhcpcanon_start(NMDhcpClient *client,
     nm_assert(pid > 0);
     _LOGI("dhcpcanon started with pid %d", pid);
     nm_dhcp_client_watch_child(client, pid);
+    nm_dhcp_client_start_timeout(self);
     priv->pid_file = g_steal_pointer(&pid_file);
     return TRUE;
 }
Index: NetworkManager-1.30.0/src/core/dhcp/nm-dhcp-dhcpcd.c
===================================================================
--- NetworkManager-1.30.0.orig/src/core/dhcp/nm-dhcp-dhcpcd.c
+++ NetworkManager-1.30.0/src/core/dhcp/nm-dhcp-dhcpcd.c
@@ -158,6 +158,7 @@ ip4_start(NMDhcpClient *client,
     nm_assert(pid > 0);
     _LOGI("dhcpcd started with pid %d", pid);
     nm_dhcp_client_watch_child(client, pid);
+    nm_dhcp_client_start_timeout(self);
     return TRUE;
 }
 

Reply via email to