Blame SOURCES/1001-wwan-dns-fix-rh2059138.patch

471b5b
From 7ba52fdcfeeb1e5400bcecb9fa93b3099dcccb47 Mon Sep 17 00:00:00 2001
471b5b
From: Beniamino Galvani <bgalvani@redhat.com>
471b5b
Date: Fri, 25 Feb 2022 10:06:48 +0100
471b5b
Subject: [PATCH] core: initialize l3cd dns-priority for ppp and wwan
471b5b
471b5b
For devices that configure IP by themselves (by returning
471b5b
"->ready_for_ip_config() = TRUE" and implementing
471b5b
->act_stage3_ip_config()), we skip manual configuration. Currently,
471b5b
manual configuration is the only one that sets flag HAS_DNS_PRIORITY
471b5b
into the resulting l3cd.
471b5b
471b5b
So, the merged l3cd for such devices misses a dns-priority and is
471b5b
ignored by the DNS manager.
471b5b
471b5b
Explicitly initialize the priority to 0; in this way, the default
471b5b
value for the device will be set in the final l3cd during the merge.
471b5b
471b5b
Fixes: 58287cbcc0c8 ('core: rework IP configuration in NetworkManager using layer 3 configuration')
471b5b
471b5b
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/931
471b5b
(cherry picked from commit b2e559fab2fa5adbf4e159fc1c2cadd3d965b01b)
471b5b
(cherry picked from commit bfd3216584e9fe1eb0b6f3f81e3eb75a40877775)
471b5b
---
471b5b
 src/core/devices/wwan/nm-modem-broadband.c | 2 ++
471b5b
 src/core/ppp/nm-ppp-manager.c              | 1 +
471b5b
 2 files changed, 3 insertions(+)
471b5b
471b5b
diff --git a/src/core/devices/wwan/nm-modem-broadband.c b/src/core/devices/wwan/nm-modem-broadband.c
471b5b
index f5336d3750..b585652e5d 100644
471b5b
--- a/src/core/devices/wwan/nm-modem-broadband.c
471b5b
+++ b/src/core/devices/wwan/nm-modem-broadband.c
471b5b
@@ -1032,6 +1032,7 @@ stage3_ip_config_start(NMModem *modem, int addr_family, NMModemIPMethod ip_metho
471b5b
         l3cd = nm_l3_config_data_new(nm_platform_get_multi_idx(NM_PLATFORM_GET),
471b5b
                                      ifindex,
471b5b
                                      NM_IP_CONFIG_SOURCE_WWAN);
471b5b
+        nm_l3_config_data_set_dns_priority(l3cd, AF_INET, 0);
471b5b
 
471b5b
         address = (NMPlatformIP4Address){
471b5b
             .address      = address_network,
471b5b
@@ -1118,6 +1119,7 @@ stage3_ip_config_start(NMModem *modem, int addr_family, NMModemIPMethod ip_metho
471b5b
         l3cd = nm_l3_config_data_new(nm_platform_get_multi_idx(NM_PLATFORM_GET),
471b5b
                                      ifindex,
471b5b
                                      NM_IP_CONFIG_SOURCE_WWAN);
471b5b
+        nm_l3_config_data_set_dns_priority(l3cd, AF_INET6, 0);
471b5b
 
471b5b
         do_auto = TRUE;
471b5b
 
471b5b
diff --git a/src/core/ppp/nm-ppp-manager.c b/src/core/ppp/nm-ppp-manager.c
471b5b
index dd6b1bc7f0..5761d59d39 100644
471b5b
--- a/src/core/ppp/nm-ppp-manager.c
471b5b
+++ b/src/core/ppp/nm-ppp-manager.c
471b5b
@@ -545,6 +545,7 @@ impl_ppp_manager_set_ip4_config(NMDBusObject                      *obj,
471b5b
                                  NM_IP_CONFIG_SOURCE_PPP);
471b5b
 
471b5b
     nm_l3_config_data_set_mtu(l3cd, mtu);
471b5b
+    nm_l3_config_data_set_dns_priority(l3cd, AF_INET, 0);
471b5b
 
471b5b
     address = (NMPlatformIP4Address){
471b5b
         .plen = 32,
471b5b
-- 
471b5b
2.34.1
471b5b