Merge ~fourdollars/ubuntu/+source/systemd:ubuntu-bionic into ~ubuntu-core-dev/ubuntu/+source/systemd:ubuntu-bionic

Proposed by Shih-Yuan Lee
Status: Merged
Merged at revision: 2357ccbc6857323d5a006e94465ce0987f1bb58d
Proposed branch: ~fourdollars/ubuntu/+source/systemd:ubuntu-bionic
Merge into: ~ubuntu-core-dev/ubuntu/+source/systemd:ubuntu-bionic
Diff against target: 432 lines (+392/-0)
6 files modified
debian/changelog (+33/-0)
debian/patches/hwdb-revert-airplane-mode-keys-handling-on-Dell.patch (+33/-0)
debian/patches/lp1668771-resolved-switch-cache-option-to-a-tri-state-option-s.patch (+229/-0)
debian/patches/lp1833671-networkd-keep-bond-slave-up-if-already-attached.patch (+50/-0)
debian/patches/lp1835581-src-network-networkd-dhcp4.c-set-prefsrc-for-classle.patch (+43/-0)
debian/patches/series (+4/-0)
Reviewer Review Type Date Requested Status
Robert Ancell (community) Approve
Shih-Yuan Lee (community) Needs Resubmitting
Dimitri John Ledkov Pending
Review via email: mp+370808@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Robert Ancell (robert-ancell) wrote :

The changelog mentions "drop Revert-udev-network-device-renaming-immediately-give.patch" but this patch still seems to be enabled.

The changelog should be updated to explicitly mention "d/p/hwdb-revert-airplane-mode-keys-handling-on-Dell.patch" as it's not clear that's what the line is referring to.

review: Needs Fixing
Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :

Please help to review my patches again.

review: Needs Resubmitting
Revision history for this message
Robert Ancell (robert-ancell) wrote :

This still has the following line in the changelog:

[ You-Sheng Yang ]
* d/p/Revert-udev-network-device-renaming-immediately-give.patch:
  - udev: drop Revert-udev-network-device-renaming-immediately-give.patch
    The removing patch was for the already deprecated
    "75-persistent-net-generator.rules" based interface renaming mechanism,
    and it's causing unnecessary problem when a system happends to NICs with
    same MAC address, e.g. Dell's MAC address pass-thru. (LP: #1837700)

There is no Revert-udev-network-device-renaming-immediately-give.patch file in debian/patches/series. So this change doesn't seem to exist?

review: Needs Fixing
Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :

This merge proposal is going to remove debian/patches/debian/Revert-udev-network-device-renaming-immediately-give.patch because it caused some regression so it is expected that you won't see it in debian/patches/series.

review: Needs Resubmitting
Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :

I have revised the commit message and debian/changelog to the right path of d/p/d/Revert-udev-network-device-renaming-immediately-give.patch.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

OK, I see the file now but it's still listed in debian/patches/series - so it's still being applied. Should that line be removed?

Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :

Revert-udev-network-device-renaming-immediately-give.patch needs to be removed.

Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :

Revert-udev-network-device-renaming-immediately-give.patch should not be listed in debian/patches/series.
https://git.launchpad.net/~fourdollars/ubuntu/+source/systemd/tree/debian/patches/series?h=ubuntu-bionic&id=2357ccbc6857323d5a006e94465ce0987f1bb58d doesn't contain Revert-udev-network-device-renaming-immediately-give.patch.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

After much discussion on IRC @fourdollars showed me how the change is there in the merge commit, which you can see using gitk. It was added to the git repository after the 237-3ubuntu10.24 release, but the 237-3ubuntu10.25 release was made without this change.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index dd35b12..eaf374a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,36 @@
1systemd (237-3ubuntu10.26) bionic; urgency=medium
2
3 [ You-Sheng Yang ]
4 * d/p/d/Revert-udev-network-device-renaming-immediately-give.patch:
5 - udev: drop Revert-udev-network-device-renaming-immediately-give.patch
6 The removing patch was for the already deprecated
7 "75-persistent-net-generator.rules" based interface renaming mechanism,
8 and it's causing unnecessary problem when a system happends to NICs with
9 same MAC address, e.g. Dell's MAC address pass-thru. (LP: #1837700)
10
11 [ Shih-Yuan Lee (FourDollars) ]
12 * d/p/hwdb-revert-airplane-mode-keys-handling-on-Dell.patch:
13 - hwdb: revert airplane mode keys handling on Dell
14 That reverts some commits those created double key events issues on some
15 Dell laptops. (LP: #1740894)
16
17 -- Shih-Yuan Lee (FourDollars) <sylee@canonical.com> Wed, 07 Aug 2019 17:56:02 +0800
18
19systemd (237-3ubuntu10.25) bionic; urgency=medium
20
21 [ Dan Streetman ]
22 * d/p/lp1835581-src-network-networkd-dhcp4.c-set-prefsrc-for-classle.patch:
23 - set src address for dhcp 'classless' routes (LP: #1835581)
24 * d/p/lp1833671-networkd-keep-bond-slave-up-if-already-attached.patch:
25 - keep bond slave up if already attached (LP: #1833671)
26
27 [ Jorge Niedbalski ]
28 * d/p/lp1668771-resolved-switch-cache-option-to-a-tri-state-option-s.patch:
29 Allows cache=no-negative option to be set, ignoring negative
30 answers to be cached (LP: #1668771).
31
32 -- Dan Streetman <ddstreet@canonical.com> Mon, 22 Jul 2019 12:45:02 -0400
33
1systemd (237-3ubuntu10.24) bionic; urgency=medium34systemd (237-3ubuntu10.24) bionic; urgency=medium
235
3 [Dimitri John Ledkov 🌈]36 [Dimitri John Ledkov 🌈]
diff --git a/debian/patches/hwdb-revert-airplane-mode-keys-handling-on-Dell.patch b/debian/patches/hwdb-revert-airplane-mode-keys-handling-on-Dell.patch
4new file mode 10064437new file mode 100644
index 0000000..b6cacd0
--- /dev/null
+++ b/debian/patches/hwdb-revert-airplane-mode-keys-handling-on-Dell.patch
@@ -0,0 +1,33 @@
1From: seb128 <seb128@ubuntu.com>
2Date: Fri, 9 Nov 2018 16:54:02 +0100
3Subject: hwdb: revert airplane mode keys handling on Dell
4
5That reverts the commits #8762 and #9868, those created double key events issues on some Dell laptops.
6---
7 hwdb/60-keyboard.hwdb | 6 +++++-
8 1 file changed, 5 insertions(+), 1 deletion(-)
9
10diff --git a/hwdb/60-keyboard.hwdb b/hwdb/60-keyboard.hwdb
11index 262e772..c4f02e9 100644
12--- a/hwdb/60-keyboard.hwdb
13+++ b/hwdb/60-keyboard.hwdb
14@@ -263,7 +263,7 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnDell*:pn*
15 KEYBOARD_KEY_85=brightnessdown # Fn+Down Brightness Down
16 KEYBOARD_KEY_86=brightnessup # Fn+Up Brightness Up
17 KEYBOARD_KEY_87=battery # Fn+F3 battery icon
18- KEYBOARD_KEY_88=!wlan # Fn+(F2|PrtScr|Home) Turn On/Off Wireless
19+ KEYBOARD_KEY_88=unknown # Fn+F2 Turn On/Off Wireless - handled in hardware
20 KEYBOARD_KEY_89=ejectclosecd # Fn+F10 Eject CD
21 KEYBOARD_KEY_8a=suspend # Fn+F1 hibernate
22 KEYBOARD_KEY_8b=switchvideomode # Fn+F8 CRT/LCD (high keycode: "displaytoggle")
23@@ -299,6 +299,10 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnDell*:pnLatitude*2110:pvr*
24 KEYBOARD_KEY_85=unknown # Brightness Down, also emitted by acpi-video, ignore
25 KEYBOARD_KEY_86=unknown # Brightness Up, also emitted by acpi-video, ignore
26
27+# Dell Inspiron 537*
28+evdev:atkbd:dmi:bvn*:bvr*:bd*:svnDell*:pnInspiron537*:pvr*
29+ KEYBOARD_KEY_88=!wlan # Fn-PrtScr rfkill
30+
31 # Latitude XT2
32 evdev:atkbd:dmi:bvn*:bvr*:bd*:svnDell*:pnLatitude*XT2:pvr*
33 KEYBOARD_KEY_9b=up # tablet rocker up
diff --git a/debian/patches/lp1668771-resolved-switch-cache-option-to-a-tri-state-option-s.patch b/debian/patches/lp1668771-resolved-switch-cache-option-to-a-tri-state-option-s.patch
0new file mode 10064434new file mode 100644
index 0000000..a524410
--- /dev/null
+++ b/debian/patches/lp1668771-resolved-switch-cache-option-to-a-tri-state-option-s.patch
@@ -0,0 +1,229 @@
1From b13ee6b829193bc9e58de7d56f3aeb9a57d0abf8 Mon Sep 17 00:00:00 2001
2From: Jorge Niedbalski <jnr@metaklass.org>
3Bug: https://github.com/systemd/systemd/issues/5552
4Origin: upstream, https://github.com/systemd/systemd/pull/13047
5Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1668771
6Date: Fri, 12 Jul 2019 15:34:24 -0400
7Subject: [PATCH] resolved: switch cache option to a tri-state option
8 (systemd#5552).
9
10Change the resolved.conf Cache option to a tri-state "no, no-negative, yes" values.
11
12If a lookup returns SERVFAIL systemd-resolved will cache the result for 30s (See 201d995),
13however, there are several use cases on which this condition is not acceptable (See systemd#5552 comments)
14and the only workaround would be to disable cache entirely or flush it , which isn't optimal.
15
16This change adds the 'no-negative' option when set it avoids putting in cache
17negative answers but still works the same heuristics for positive answers.
18
19Signed-off-by: Jorge Niedbalski <jnr@metaklass.org>
20---
21 man/resolved.conf.xml | 9 +++++----
22 src/resolve/resolved-dns-cache.c | 8 ++++++++
23 src/resolve/resolved-dns-cache.h | 3 ++-
24 src/resolve/resolved-dns-transaction.c | 3 ++-
25 src/resolve/resolved-gperf.gperf | 2 +-
26 src/resolve/resolved-manager.c | 2 +-
27 src/resolve/resolved-manager.h | 2 +-
28 src/resolve/resolved-mdns.c | 2 +-
29 src/shared/resolve-util.c | 9 +++++++++
30 src/shared/resolve-util.h | 18 ++++++++++++++++++
31 10 files changed, 48 insertions(+), 10 deletions(-)
32
33diff --git a/man/resolved.conf.xml b/man/resolved.conf.xml
34index bf88c0e950..84e31616ed 100644
35--- a/man/resolved.conf.xml
36+++ b/man/resolved.conf.xml
37@@ -221,10 +221,11 @@
38
39 <varlistentry>
40 <term><varname>Cache=</varname></term>
41- <listitem><para>Takes a boolean argument. If "yes" (the default), resolving a domain name which already got
42- queried earlier will return the previous result as long as it is still valid, and thus does not result in a new
43- network request. Be aware that turning off caching comes at a performance penalty, which is particularly
44- high when DNSSEC is used.</para>
45+ <listitem><para>Takes a boolean or <literal>no-negative</literal> as argument. If <literal>yes</literal> (the default), resolving a domain name
46+ which already got queried earlier will return the previous result as long as it is still valid, and thus does
47+ not result in a new network request. Be aware that turning off caching comes at a performance penalty, which
48+ is particularly high when DNSSEC is used.</para>
49+ If <literal>no-negative</literal>, only positive answers are cached.
50
51 <para>Note that caching is turned off implicitly if the configured DNS server is on a host-local IP address
52 (such as 127.0.0.1 or ::1), in order to avoid duplicate local caching.</para></listitem>
53diff --git a/src/resolve/resolved-dns-cache.c b/src/resolve/resolved-dns-cache.c
54index b653a20b6e..bd809fa5b1 100644
55--- a/src/resolve/resolved-dns-cache.c
56+++ b/src/resolve/resolved-dns-cache.c
57@@ -641,6 +641,7 @@ static bool rr_eligible(DnsResourceRecord *rr) {
58
59 int dns_cache_put(
60 DnsCache *c,
61+ DnsCacheMode cache_mode,
62 DnsResourceKey *key,
63 int rcode,
64 DnsAnswer *answer,
65@@ -752,6 +753,13 @@ int dns_cache_put(
66 return 0;
67 }
68
69+ if (cache_mode == DNS_CACHE_MODE_NO_NEGATIVE) {
70+ char key_str[DNS_RESOURCE_KEY_STRING_MAX];
71+ log_debug("Not caching negative entry for: %s, cache mode set to no-negative",
72+ dns_resource_key_to_string(key, key_str, sizeof key_str));
73+ return 0;
74+ }
75+
76 r = dns_cache_put_negative(
77 c,
78 key,
79diff --git a/src/resolve/resolved-dns-cache.h b/src/resolve/resolved-dns-cache.h
80index a5ace2c4c6..348bb62c50 100644
81--- a/src/resolve/resolved-dns-cache.h
82+++ b/src/resolve/resolved-dns-cache.h
83@@ -23,6 +23,7 @@
84 #include "hashmap.h"
85 #include "list.h"
86 #include "prioq.h"
87+#include "resolve-util.h"
88 #include "time-util.h"
89
90 typedef struct DnsCache {
91@@ -40,7 +41,7 @@ typedef struct DnsCache {
92 void dns_cache_flush(DnsCache *c);
93 void dns_cache_prune(DnsCache *c);
94
95-int dns_cache_put(DnsCache *c, DnsResourceKey *key, int rcode, DnsAnswer *answer, bool authenticated, uint32_t nsec_ttl, usec_t timestamp, int owner_family, const union in_addr_union *owner_address);
96+int dns_cache_put(DnsCache *c, DnsCacheMode cache_mode, DnsResourceKey *key, int rcode, DnsAnswer *answer, bool authenticated, uint32_t nsec_ttl, usec_t timestamp, int owner_family, const union in_addr_union *owner_address);
97 int dns_cache_lookup(DnsCache *c, DnsResourceKey *key, bool clamp_ttl, int *rcode, DnsAnswer **answer, bool *authenticated);
98
99 int dns_cache_check_conflicts(DnsCache *cache, DnsResourceRecord *rr, int owner_family, const union in_addr_union *owner_address);
100diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c
101index f500ec20a0..eb0c0c8ce1 100644
102--- a/src/resolve/resolved-dns-transaction.c
103+++ b/src/resolve/resolved-dns-transaction.c
104@@ -614,7 +614,7 @@ static void dns_transaction_cache_answer(DnsTransaction *t) {
105 return;
106
107 /* Caching disabled? */
108- if (!t->scope->manager->enable_cache)
109+ if (t->scope->manager->enable_cache == DNS_CACHE_MODE_NO)
110 return;
111
112 /* We never cache if this packet is from the local host, under
113@@ -625,6 +625,7 @@ static void dns_transaction_cache_answer(DnsTransaction *t) {
114 return;
115
116 dns_cache_put(&t->scope->cache,
117+ t->scope->manager->enable_cache,
118 t->key,
119 t->answer_rcode,
120 t->answer,
121diff --git a/src/resolve/resolved-gperf.gperf b/src/resolve/resolved-gperf.gperf
122index a5865ce6c2..a4a461823b 100644
123--- a/src/resolve/resolved-gperf.gperf
124+++ b/src/resolve/resolved-gperf.gperf
125@@ -23,5 +23,5 @@ Resolve.Domains, config_parse_search_domains, 0,
126 Resolve.LLMNR, config_parse_resolve_support, 0, offsetof(Manager, llmnr_support)
127 Resolve.MulticastDNS, config_parse_resolve_support, 0, offsetof(Manager, mdns_support)
128 Resolve.DNSSEC, config_parse_dnssec_mode, 0, offsetof(Manager, dnssec_mode)
129-Resolve.Cache, config_parse_bool, 0, offsetof(Manager, enable_cache)
130+Resolve.Cache, config_parse_dns_cache_mode, DNS_CACHE_MODE_YES, offsetof(Manager, enable_cache)
131 Resolve.DNSStubListener, config_parse_dns_stub_listener_mode, 0, offsetof(Manager, dns_stub_listener_mode)
132diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c
133index 12a9d17107..2c0dc707bb 100644
134--- a/src/resolve/resolved-manager.c
135+++ b/src/resolve/resolved-manager.c
136@@ -599,7 +599,7 @@ int manager_new(Manager **ret) {
137 m->llmnr_support = RESOLVE_SUPPORT_NO;
138 m->mdns_support = RESOLVE_SUPPORT_NO;
139 m->dnssec_mode = DEFAULT_DNSSEC_MODE;
140- m->enable_cache = true;
141+ m->enable_cache = DNS_CACHE_MODE_YES;
142 m->dns_stub_listener_mode = DNS_STUB_LISTENER_YES;
143 m->read_resolv_conf = true;
144 m->need_builtin_fallbacks = true;
145diff --git a/src/resolve/resolved-manager.h b/src/resolve/resolved-manager.h
146index 5c1a6670ef..072072d2e3 100644
147--- a/src/resolve/resolved-manager.h
148+++ b/src/resolve/resolved-manager.h
149@@ -48,7 +48,7 @@ struct Manager {
150 ResolveSupport llmnr_support;
151 ResolveSupport mdns_support;
152 DnssecMode dnssec_mode;
153- bool enable_cache;
154+ DnsCacheMode enable_cache;
155 DnsStubListenerMode dns_stub_listener_mode;
156
157 /* Network */
158diff --git a/src/resolve/resolved-mdns.c b/src/resolve/resolved-mdns.c
159index 38e2c54227..1d7d3602ad 100644
160--- a/src/resolve/resolved-mdns.c
161+++ b/src/resolve/resolved-mdns.c
162@@ -351,7 +351,7 @@ static int on_mdns_packet(sd_event_source *s, int fd, uint32_t revents, void *us
163 dns_transaction_process_reply(t, p);
164 }
165
166- dns_cache_put(&scope->cache, NULL, DNS_PACKET_RCODE(p), p->answer, false, (uint32_t) -1, 0, p->family, &p->sender);
167+ dns_cache_put(&scope->cache, scope->manager->enable_cache, NULL, DNS_PACKET_RCODE(p), p->answer, false, (uint32_t) -1, 0, p->family, &p->sender);
168
169 } else if (dns_packet_validate_query(p) > 0) {
170 log_debug("Got mDNS query packet for id %u", DNS_PACKET_ID(p));
171diff --git a/src/shared/resolve-util.c b/src/shared/resolve-util.c
172index edcb8e05e7..90a4efcd1d 100644
173--- a/src/shared/resolve-util.c
174+++ b/src/shared/resolve-util.c
175@@ -38,3 +38,12 @@ static const char* const dnssec_mode_table[_DNSSEC_MODE_MAX] = {
176 [DNSSEC_YES] = "yes",
177 };
178 DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(dnssec_mode, DnssecMode, DNSSEC_YES);
179+DEFINE_CONFIG_PARSE_ENUM(config_parse_dns_cache_mode, dns_cache_mode, DnsCacheMode, "Failed to parse DNS cache mode setting")
180+
181+static const char* const dns_cache_mode_table[_DNS_CACHE_MODE_MAX] = {
182+ [DNS_CACHE_MODE_YES] = "yes",
183+ [DNS_CACHE_MODE_NO] = "no",
184+ [DNS_CACHE_MODE_NO_NEGATIVE] = "no-negative",
185+};
186+
187+DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(dns_cache_mode, DnsCacheMode, DNS_CACHE_MODE_YES);
188diff --git a/src/shared/resolve-util.h b/src/shared/resolve-util.h
189index 975156ca96..b235b97332 100644
190--- a/src/shared/resolve-util.h
191+++ b/src/shared/resolve-util.h
192@@ -22,6 +22,16 @@
193
194 #include "macro.h"
195
196+typedef enum DnsCacheMode DnsCacheMode;
197+
198+enum DnsCacheMode {
199+ DNS_CACHE_MODE_NO,
200+ DNS_CACHE_MODE_YES,
201+ DNS_CACHE_MODE_NO_NEGATIVE,
202+ _DNS_CACHE_MODE_MAX,
203+ _DNS_CACHE_MODE_INVALID = 1
204+};
205+
206 typedef enum ResolveSupport ResolveSupport;
207 typedef enum DnssecMode DnssecMode;
208
209@@ -53,9 +63,17 @@ enum DnssecMode {
210
211 int config_parse_resolve_support(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
212 int config_parse_dnssec_mode(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
213+int config_parse_dns_cache_mode(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
214+
215+CONFIG_PARSER_PROTOTYPE(config_parse_resolve_support);
216+CONFIG_PARSER_PROTOTYPE(config_parse_dnssec_mode);
217+CONFIG_PARSER_PROTOTYPE(config_parse_dns_cache_mode);
218
219 const char* resolve_support_to_string(ResolveSupport p) _const_;
220 ResolveSupport resolve_support_from_string(const char *s) _pure_;
221
222 const char* dnssec_mode_to_string(DnssecMode p) _const_;
223 DnssecMode dnssec_mode_from_string(const char *s) _pure_;
224+
225+const char* dns_cache_mode_to_string(DnsCacheMode p) _const_;
226+DnsCacheMode dns_cache_mode_from_string(const char *s) _pure_;
227--
2282.20.1
229
diff --git a/debian/patches/lp1833671-networkd-keep-bond-slave-up-if-already-attached.patch b/debian/patches/lp1833671-networkd-keep-bond-slave-up-if-already-attached.patch
0new file mode 100644230new file mode 100644
index 0000000..b1b9149
--- /dev/null
+++ b/debian/patches/lp1833671-networkd-keep-bond-slave-up-if-already-attached.patch
@@ -0,0 +1,50 @@
1From cbff717048ad25b2fb47ea3df688f9df7e6af6c7 Mon Sep 17 00:00:00 2001
2From: Tobias Jungel <tobias.jungel@bisdn.de>
3Origin: upstream, https://github.com/systemd/systemd/commit/cbff717048ad25b2fb47ea3df688f9df7e6af6c7
4Bug: https://github.com/systemd/systemd/issues/10118
5Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1833671
6Date: Fri, 19 Oct 2018 13:12:35 +0200
7Subject: [PATCH] networkd: keep bond slave up if already attached
8
9There is no need to disable an already correct enslaved interface.
10
11relates to #10118
12---
13 src/network/networkd-link.c | 8 ++++++++
14 src/network/networkd-link.h | 1 +
15 2 files changed, 9 insertions(+)
16
17--- a/src/network/networkd-link.c
18+++ b/src/network/networkd-link.c
19@@ -483,6 +483,10 @@
20 return -ENOMEM;
21 }
22
23+ r = sd_netlink_message_read_u32(message, IFLA_MASTER, (uint32_t *)&link->master_ifindex);
24+ if (r < 0)
25+ log_link_debug_errno(link, r, "New device has no master, continuing without");
26+
27 r = sd_netlink_message_read_ether_addr(message, IFLA_ADDRESS, &link->mac);
28 if (r < 0)
29 log_link_debug_errno(link, r, "MAC address not found for new device, continuing without");
30@@ -2280,6 +2284,10 @@
31 return link_joined(link);
32
33 if (link->network->bond) {
34+ if (link->network->bond->state == NETDEV_STATE_READY &&
35+ link->network->bond->ifindex == link->master_ifindex)
36+ return link_joined(link);
37+
38 log_struct(LOG_DEBUG,
39 LOG_LINK_INTERFACE(link),
40 LOG_NETDEV_INTERFACE(link->network->bond),
41--- a/src/network/networkd-link.h
42+++ b/src/network/networkd-link.h
43@@ -67,6 +67,7 @@
44 int n_ref;
45
46 int ifindex;
47+ int master_ifindex;
48 char *ifname;
49 char *kind;
50 unsigned short iftype;
diff --git a/debian/patches/lp1835581-src-network-networkd-dhcp4.c-set-prefsrc-for-classle.patch b/debian/patches/lp1835581-src-network-networkd-dhcp4.c-set-prefsrc-for-classle.patch
0new file mode 10064451new file mode 100644
index 0000000..00f3af3
--- /dev/null
+++ b/debian/patches/lp1835581-src-network-networkd-dhcp4.c-set-prefsrc-for-classle.patch
@@ -0,0 +1,43 @@
1From ac2dce5f36bb8b1a877ff765e6a4dfde6bfb2d49 Mon Sep 17 00:00:00 2001
2From: Dan Streetman <ddstreet@canonical.com>
3Bug: https://github.com/systemd/systemd/issues/12969
4Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1835581
5Origin: upstream, https://github.com/systemd/systemd/commit/ac2dce5f36bb8b1a877ff765e6a4dfde6bfb2d49
6Date: Fri, 5 Jul 2019 16:42:38 -0400
7Subject: [PATCH] src/network/networkd-dhcp4.c: set prefsrc for classless or
8 static routes
9
10When a DHCP server provides only a gateway, the networkd-dhcp4 code adds a
11default route using that gateway, and sets the just-provided address as
12the route's prefsrc; this was added in commit
1346b0c76e2c355c0d0cc4792abb98cde07b28bc53
14
15However, if the DHCP server has also provided classless route(s), these
16are used instead of a default route using the provided gateway; the
17networkd-dhcp4 code sets up the classless routes, but does not use the
18just-provided dhcp address as the prefsrc of the route(s). Note that
19it also doesn't set the prefsrc for static routes, though it should.
20
21If the interface has only the dhcp-provided address, this is not usually
22a problem, but if it has another address (e.g. a static address), then
23traffic sent through the dhcp-provided gateway might not use the
24dhcp-provided source address. If the gateway router only will route
25traffic from the dhcp-provided address, then the dhcp client system's
26networking through the router will not work.
27
28Fixes: #12969
29---
30 src/network/networkd-dhcp4.c | 4 ++++
31 1 file changed, 4 insertions(+)
32
33--- a/src/network/networkd-dhcp4.c
34+++ b/src/network/networkd-dhcp4.c
35@@ -130,6 +130,8 @@
36 route->priority = link->network->dhcp_route_metric;
37 route->table = table;
38 route->scope = route_scope_from_address(route, &address);
39+ if (IN_SET(route->scope, RT_SCOPE_LINK, RT_SCOPE_UNIVERSE))
40+ route->prefsrc.in = address;
41
42 r = route_configure(route, link, dhcp4_route_handler);
43 if (r < 0)
diff --git a/debian/patches/series b/debian/patches/series
index 40073dd..afe70cd 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -118,3 +118,7 @@ resolved-do-not-hit-CNAME-in-NODATA.patch
118exec-util-in-execute_directories-support-initial-exec-env.patch118exec-util-in-execute_directories-support-initial-exec-env.patch
119core-execute-environment_generators-with-manager-s-enviro.patch119core-execute-environment_generators-with-manager-s-enviro.patch
120core-execute-generators-with-manager-s-environmnet.patch120core-execute-generators-with-manager-s-environmnet.patch
121lp1835581-src-network-networkd-dhcp4.c-set-prefsrc-for-classle.patch
122lp1668771-resolved-switch-cache-option-to-a-tri-state-option-s.patch
123lp1833671-networkd-keep-bond-slave-up-if-already-attached.patch
124hwdb-revert-airplane-mode-keys-handling-on-Dell.patch

Subscribers

People subscribed via source and target branches