Blame SOURCES/1000-platform-fix-capturing-addresses-from-platform-for-assuming-after-restart.patch

562755
From af06ca8b1190240146f746f8aeca6fd11bfbe6ad Mon Sep 17 00:00:00 2001
562755
From: Thomas Haller <thaller@redhat.com>
562755
Date: Thu, 19 Aug 2021 13:35:27 +0200
562755
Subject: [PATCH] platform: fix capturing addresses from platform for assuming
562755
 after restart
562755
562755
Commit c631aa48f034 ('platform: capture NMIP[46]Config from platform
562755
with correct (reversed) order of IP addresses') changed this for IPv6
562755
and IPv4, but it's not correct for IPv4.
562755
562755
For IPv6, later `ip addr add` calls adds a new primary address, which
562755
is also listed in `ip addr show` first. Hence, as NMIP6Config tracks
562755
addresses in increasing priority, while NMPlatform tracks them as
562755
exposed by kernel, the order when appending addresses form platform
562755
to NMIP6Config must be reversed.
562755
562755
That is not the case for IPv4. For IPv4, later `ip addr add` calls
562755
add a secondary IP address. Also, in `ip addr show` output they are
562755
appended. Consequently, IPv4 addresses are tracked by NMPlatform with
562755
decreasing priority (in the reverse order than for IPv6).
562755
562755
Fix constructing the NMIP4Config by fixing the address order. This is
562755
important, because during restart devices get assumed and our code would
562755
configure the order of addresses as it finds them.
562755
562755
Fixes: c631aa48f034 ('platform: capture NMIP[46]Config from platform with correct (reversed) order of IP addresses')
562755
(cherry picked from commit c380893dc6757e30b429f968bc90bc1edda68998)
562755
(cherry picked from commit 605373b38ab463826bd7eb80408fb2cfae07ee91)
562755
---
562755
 src/core/nm-ip4-config.c | 2 +-
562755
 1 file changed, 1 insertion(+), 1 deletion(-)
562755
562755
diff --git a/src/core/nm-ip4-config.c b/src/core/nm-ip4-config.c
562755
index 90531d0291..52a8faa791 100644
562755
--- a/src/core/nm-ip4-config.c
562755
+++ b/src/core/nm-ip4-config.c
562755
@@ -543,7 +543,7 @@ nm_ip4_config_capture(NMDedupMultiIndex *multi_idx, NMPlatform *platform, int if
562755
 
562755
     head_entry = nm_platform_lookup_object(platform, NMP_OBJECT_TYPE_IP4_ADDRESS, ifindex);
562755
     if (head_entry) {
562755
-        nmp_cache_iter_for_each_reverse (&iter, head_entry, &plobj) {
562755
+        nmp_cache_iter_for_each (&iter, head_entry, &plobj) {
562755
             if (!_nm_ip_config_add_obj(priv->multi_idx,
562755
                                        &priv->idx_ip4_addresses_,
562755
                                        ifindex,
562755
-- 
562755
2.26.3
562755