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 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
1diff --git a/debian/changelog b/debian/changelog
2index dd35b12..eaf374a 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,36 @@
6+systemd (237-3ubuntu10.26) bionic; urgency=medium
7+
8+ [ You-Sheng Yang ]
9+ * d/p/d/Revert-udev-network-device-renaming-immediately-give.patch:
10+ - udev: drop Revert-udev-network-device-renaming-immediately-give.patch
11+ The removing patch was for the already deprecated
12+ "75-persistent-net-generator.rules" based interface renaming mechanism,
13+ and it's causing unnecessary problem when a system happends to NICs with
14+ same MAC address, e.g. Dell's MAC address pass-thru. (LP: #1837700)
15+
16+ [ Shih-Yuan Lee (FourDollars) ]
17+ * d/p/hwdb-revert-airplane-mode-keys-handling-on-Dell.patch:
18+ - hwdb: revert airplane mode keys handling on Dell
19+ That reverts some commits those created double key events issues on some
20+ Dell laptops. (LP: #1740894)
21+
22+ -- Shih-Yuan Lee (FourDollars) <sylee@canonical.com> Wed, 07 Aug 2019 17:56:02 +0800
23+
24+systemd (237-3ubuntu10.25) bionic; urgency=medium
25+
26+ [ Dan Streetman ]
27+ * d/p/lp1835581-src-network-networkd-dhcp4.c-set-prefsrc-for-classle.patch:
28+ - set src address for dhcp 'classless' routes (LP: #1835581)
29+ * d/p/lp1833671-networkd-keep-bond-slave-up-if-already-attached.patch:
30+ - keep bond slave up if already attached (LP: #1833671)
31+
32+ [ Jorge Niedbalski ]
33+ * d/p/lp1668771-resolved-switch-cache-option-to-a-tri-state-option-s.patch:
34+ Allows cache=no-negative option to be set, ignoring negative
35+ answers to be cached (LP: #1668771).
36+
37+ -- Dan Streetman <ddstreet@canonical.com> Mon, 22 Jul 2019 12:45:02 -0400
38+
39 systemd (237-3ubuntu10.24) bionic; urgency=medium
40
41 [Dimitri John Ledkov 🌈]
42diff --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
43new file mode 100644
44index 0000000..b6cacd0
45--- /dev/null
46+++ b/debian/patches/hwdb-revert-airplane-mode-keys-handling-on-Dell.patch
47@@ -0,0 +1,33 @@
48+From: seb128 <seb128@ubuntu.com>
49+Date: Fri, 9 Nov 2018 16:54:02 +0100
50+Subject: hwdb: revert airplane mode keys handling on Dell
51+
52+That reverts the commits #8762 and #9868, those created double key events issues on some Dell laptops.
53+---
54+ hwdb/60-keyboard.hwdb | 6 +++++-
55+ 1 file changed, 5 insertions(+), 1 deletion(-)
56+
57+diff --git a/hwdb/60-keyboard.hwdb b/hwdb/60-keyboard.hwdb
58+index 262e772..c4f02e9 100644
59+--- a/hwdb/60-keyboard.hwdb
60++++ b/hwdb/60-keyboard.hwdb
61+@@ -263,7 +263,7 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnDell*:pn*
62+ KEYBOARD_KEY_85=brightnessdown # Fn+Down Brightness Down
63+ KEYBOARD_KEY_86=brightnessup # Fn+Up Brightness Up
64+ KEYBOARD_KEY_87=battery # Fn+F3 battery icon
65+- KEYBOARD_KEY_88=!wlan # Fn+(F2|PrtScr|Home) Turn On/Off Wireless
66++ KEYBOARD_KEY_88=unknown # Fn+F2 Turn On/Off Wireless - handled in hardware
67+ KEYBOARD_KEY_89=ejectclosecd # Fn+F10 Eject CD
68+ KEYBOARD_KEY_8a=suspend # Fn+F1 hibernate
69+ KEYBOARD_KEY_8b=switchvideomode # Fn+F8 CRT/LCD (high keycode: "displaytoggle")
70+@@ -299,6 +299,10 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnDell*:pnLatitude*2110:pvr*
71+ KEYBOARD_KEY_85=unknown # Brightness Down, also emitted by acpi-video, ignore
72+ KEYBOARD_KEY_86=unknown # Brightness Up, also emitted by acpi-video, ignore
73+
74++# Dell Inspiron 537*
75++evdev:atkbd:dmi:bvn*:bvr*:bd*:svnDell*:pnInspiron537*:pvr*
76++ KEYBOARD_KEY_88=!wlan # Fn-PrtScr rfkill
77++
78+ # Latitude XT2
79+ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnDell*:pnLatitude*XT2:pvr*
80+ KEYBOARD_KEY_9b=up # tablet rocker up
81diff --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
82new file mode 100644
83index 0000000..a524410
84--- /dev/null
85+++ b/debian/patches/lp1668771-resolved-switch-cache-option-to-a-tri-state-option-s.patch
86@@ -0,0 +1,229 @@
87+From b13ee6b829193bc9e58de7d56f3aeb9a57d0abf8 Mon Sep 17 00:00:00 2001
88+From: Jorge Niedbalski <jnr@metaklass.org>
89+Bug: https://github.com/systemd/systemd/issues/5552
90+Origin: upstream, https://github.com/systemd/systemd/pull/13047
91+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1668771
92+Date: Fri, 12 Jul 2019 15:34:24 -0400
93+Subject: [PATCH] resolved: switch cache option to a tri-state option
94+ (systemd#5552).
95+
96+Change the resolved.conf Cache option to a tri-state "no, no-negative, yes" values.
97+
98+If a lookup returns SERVFAIL systemd-resolved will cache the result for 30s (See 201d995),
99+however, there are several use cases on which this condition is not acceptable (See systemd#5552 comments)
100+and the only workaround would be to disable cache entirely or flush it , which isn't optimal.
101+
102+This change adds the 'no-negative' option when set it avoids putting in cache
103+negative answers but still works the same heuristics for positive answers.
104+
105+Signed-off-by: Jorge Niedbalski <jnr@metaklass.org>
106+---
107+ man/resolved.conf.xml | 9 +++++----
108+ src/resolve/resolved-dns-cache.c | 8 ++++++++
109+ src/resolve/resolved-dns-cache.h | 3 ++-
110+ src/resolve/resolved-dns-transaction.c | 3 ++-
111+ src/resolve/resolved-gperf.gperf | 2 +-
112+ src/resolve/resolved-manager.c | 2 +-
113+ src/resolve/resolved-manager.h | 2 +-
114+ src/resolve/resolved-mdns.c | 2 +-
115+ src/shared/resolve-util.c | 9 +++++++++
116+ src/shared/resolve-util.h | 18 ++++++++++++++++++
117+ 10 files changed, 48 insertions(+), 10 deletions(-)
118+
119+diff --git a/man/resolved.conf.xml b/man/resolved.conf.xml
120+index bf88c0e950..84e31616ed 100644
121+--- a/man/resolved.conf.xml
122++++ b/man/resolved.conf.xml
123+@@ -221,10 +221,11 @@
124+
125+ <varlistentry>
126+ <term><varname>Cache=</varname></term>
127+- <listitem><para>Takes a boolean argument. If "yes" (the default), resolving a domain name which already got
128+- queried earlier will return the previous result as long as it is still valid, and thus does not result in a new
129+- network request. Be aware that turning off caching comes at a performance penalty, which is particularly
130+- high when DNSSEC is used.</para>
131++ <listitem><para>Takes a boolean or <literal>no-negative</literal> as argument. If <literal>yes</literal> (the default), resolving a domain name
132++ which already got queried earlier will return the previous result as long as it is still valid, and thus does
133++ not result in a new network request. Be aware that turning off caching comes at a performance penalty, which
134++ is particularly high when DNSSEC is used.</para>
135++ If <literal>no-negative</literal>, only positive answers are cached.
136+
137+ <para>Note that caching is turned off implicitly if the configured DNS server is on a host-local IP address
138+ (such as 127.0.0.1 or ::1), in order to avoid duplicate local caching.</para></listitem>
139+diff --git a/src/resolve/resolved-dns-cache.c b/src/resolve/resolved-dns-cache.c
140+index b653a20b6e..bd809fa5b1 100644
141+--- a/src/resolve/resolved-dns-cache.c
142++++ b/src/resolve/resolved-dns-cache.c
143+@@ -641,6 +641,7 @@ static bool rr_eligible(DnsResourceRecord *rr) {
144+
145+ int dns_cache_put(
146+ DnsCache *c,
147++ DnsCacheMode cache_mode,
148+ DnsResourceKey *key,
149+ int rcode,
150+ DnsAnswer *answer,
151+@@ -752,6 +753,13 @@ int dns_cache_put(
152+ return 0;
153+ }
154+
155++ if (cache_mode == DNS_CACHE_MODE_NO_NEGATIVE) {
156++ char key_str[DNS_RESOURCE_KEY_STRING_MAX];
157++ log_debug("Not caching negative entry for: %s, cache mode set to no-negative",
158++ dns_resource_key_to_string(key, key_str, sizeof key_str));
159++ return 0;
160++ }
161++
162+ r = dns_cache_put_negative(
163+ c,
164+ key,
165+diff --git a/src/resolve/resolved-dns-cache.h b/src/resolve/resolved-dns-cache.h
166+index a5ace2c4c6..348bb62c50 100644
167+--- a/src/resolve/resolved-dns-cache.h
168++++ b/src/resolve/resolved-dns-cache.h
169+@@ -23,6 +23,7 @@
170+ #include "hashmap.h"
171+ #include "list.h"
172+ #include "prioq.h"
173++#include "resolve-util.h"
174+ #include "time-util.h"
175+
176+ typedef struct DnsCache {
177+@@ -40,7 +41,7 @@ typedef struct DnsCache {
178+ void dns_cache_flush(DnsCache *c);
179+ void dns_cache_prune(DnsCache *c);
180+
181+-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);
182++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);
183+ int dns_cache_lookup(DnsCache *c, DnsResourceKey *key, bool clamp_ttl, int *rcode, DnsAnswer **answer, bool *authenticated);
184+
185+ int dns_cache_check_conflicts(DnsCache *cache, DnsResourceRecord *rr, int owner_family, const union in_addr_union *owner_address);
186+diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c
187+index f500ec20a0..eb0c0c8ce1 100644
188+--- a/src/resolve/resolved-dns-transaction.c
189++++ b/src/resolve/resolved-dns-transaction.c
190+@@ -614,7 +614,7 @@ static void dns_transaction_cache_answer(DnsTransaction *t) {
191+ return;
192+
193+ /* Caching disabled? */
194+- if (!t->scope->manager->enable_cache)
195++ if (t->scope->manager->enable_cache == DNS_CACHE_MODE_NO)
196+ return;
197+
198+ /* We never cache if this packet is from the local host, under
199+@@ -625,6 +625,7 @@ static void dns_transaction_cache_answer(DnsTransaction *t) {
200+ return;
201+
202+ dns_cache_put(&t->scope->cache,
203++ t->scope->manager->enable_cache,
204+ t->key,
205+ t->answer_rcode,
206+ t->answer,
207+diff --git a/src/resolve/resolved-gperf.gperf b/src/resolve/resolved-gperf.gperf
208+index a5865ce6c2..a4a461823b 100644
209+--- a/src/resolve/resolved-gperf.gperf
210++++ b/src/resolve/resolved-gperf.gperf
211+@@ -23,5 +23,5 @@ Resolve.Domains, config_parse_search_domains, 0,
212+ Resolve.LLMNR, config_parse_resolve_support, 0, offsetof(Manager, llmnr_support)
213+ Resolve.MulticastDNS, config_parse_resolve_support, 0, offsetof(Manager, mdns_support)
214+ Resolve.DNSSEC, config_parse_dnssec_mode, 0, offsetof(Manager, dnssec_mode)
215+-Resolve.Cache, config_parse_bool, 0, offsetof(Manager, enable_cache)
216++Resolve.Cache, config_parse_dns_cache_mode, DNS_CACHE_MODE_YES, offsetof(Manager, enable_cache)
217+ Resolve.DNSStubListener, config_parse_dns_stub_listener_mode, 0, offsetof(Manager, dns_stub_listener_mode)
218+diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c
219+index 12a9d17107..2c0dc707bb 100644
220+--- a/src/resolve/resolved-manager.c
221++++ b/src/resolve/resolved-manager.c
222+@@ -599,7 +599,7 @@ int manager_new(Manager **ret) {
223+ m->llmnr_support = RESOLVE_SUPPORT_NO;
224+ m->mdns_support = RESOLVE_SUPPORT_NO;
225+ m->dnssec_mode = DEFAULT_DNSSEC_MODE;
226+- m->enable_cache = true;
227++ m->enable_cache = DNS_CACHE_MODE_YES;
228+ m->dns_stub_listener_mode = DNS_STUB_LISTENER_YES;
229+ m->read_resolv_conf = true;
230+ m->need_builtin_fallbacks = true;
231+diff --git a/src/resolve/resolved-manager.h b/src/resolve/resolved-manager.h
232+index 5c1a6670ef..072072d2e3 100644
233+--- a/src/resolve/resolved-manager.h
234++++ b/src/resolve/resolved-manager.h
235+@@ -48,7 +48,7 @@ struct Manager {
236+ ResolveSupport llmnr_support;
237+ ResolveSupport mdns_support;
238+ DnssecMode dnssec_mode;
239+- bool enable_cache;
240++ DnsCacheMode enable_cache;
241+ DnsStubListenerMode dns_stub_listener_mode;
242+
243+ /* Network */
244+diff --git a/src/resolve/resolved-mdns.c b/src/resolve/resolved-mdns.c
245+index 38e2c54227..1d7d3602ad 100644
246+--- a/src/resolve/resolved-mdns.c
247++++ b/src/resolve/resolved-mdns.c
248+@@ -351,7 +351,7 @@ static int on_mdns_packet(sd_event_source *s, int fd, uint32_t revents, void *us
249+ dns_transaction_process_reply(t, p);
250+ }
251+
252+- dns_cache_put(&scope->cache, NULL, DNS_PACKET_RCODE(p), p->answer, false, (uint32_t) -1, 0, p->family, &p->sender);
253++ 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);
254+
255+ } else if (dns_packet_validate_query(p) > 0) {
256+ log_debug("Got mDNS query packet for id %u", DNS_PACKET_ID(p));
257+diff --git a/src/shared/resolve-util.c b/src/shared/resolve-util.c
258+index edcb8e05e7..90a4efcd1d 100644
259+--- a/src/shared/resolve-util.c
260++++ b/src/shared/resolve-util.c
261+@@ -38,3 +38,12 @@ static const char* const dnssec_mode_table[_DNSSEC_MODE_MAX] = {
262+ [DNSSEC_YES] = "yes",
263+ };
264+ DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(dnssec_mode, DnssecMode, DNSSEC_YES);
265++DEFINE_CONFIG_PARSE_ENUM(config_parse_dns_cache_mode, dns_cache_mode, DnsCacheMode, "Failed to parse DNS cache mode setting")
266++
267++static const char* const dns_cache_mode_table[_DNS_CACHE_MODE_MAX] = {
268++ [DNS_CACHE_MODE_YES] = "yes",
269++ [DNS_CACHE_MODE_NO] = "no",
270++ [DNS_CACHE_MODE_NO_NEGATIVE] = "no-negative",
271++};
272++
273++DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(dns_cache_mode, DnsCacheMode, DNS_CACHE_MODE_YES);
274+diff --git a/src/shared/resolve-util.h b/src/shared/resolve-util.h
275+index 975156ca96..b235b97332 100644
276+--- a/src/shared/resolve-util.h
277++++ b/src/shared/resolve-util.h
278+@@ -22,6 +22,16 @@
279+
280+ #include "macro.h"
281+
282++typedef enum DnsCacheMode DnsCacheMode;
283++
284++enum DnsCacheMode {
285++ DNS_CACHE_MODE_NO,
286++ DNS_CACHE_MODE_YES,
287++ DNS_CACHE_MODE_NO_NEGATIVE,
288++ _DNS_CACHE_MODE_MAX,
289++ _DNS_CACHE_MODE_INVALID = 1
290++};
291++
292+ typedef enum ResolveSupport ResolveSupport;
293+ typedef enum DnssecMode DnssecMode;
294+
295+@@ -53,9 +63,17 @@ enum DnssecMode {
296+
297+ 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);
298+ 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);
299++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);
300++
301++CONFIG_PARSER_PROTOTYPE(config_parse_resolve_support);
302++CONFIG_PARSER_PROTOTYPE(config_parse_dnssec_mode);
303++CONFIG_PARSER_PROTOTYPE(config_parse_dns_cache_mode);
304+
305+ const char* resolve_support_to_string(ResolveSupport p) _const_;
306+ ResolveSupport resolve_support_from_string(const char *s) _pure_;
307+
308+ const char* dnssec_mode_to_string(DnssecMode p) _const_;
309+ DnssecMode dnssec_mode_from_string(const char *s) _pure_;
310++
311++const char* dns_cache_mode_to_string(DnsCacheMode p) _const_;
312++DnsCacheMode dns_cache_mode_from_string(const char *s) _pure_;
313+--
314+2.20.1
315+
316diff --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
317new file mode 100644
318index 0000000..b1b9149
319--- /dev/null
320+++ b/debian/patches/lp1833671-networkd-keep-bond-slave-up-if-already-attached.patch
321@@ -0,0 +1,50 @@
322+From cbff717048ad25b2fb47ea3df688f9df7e6af6c7 Mon Sep 17 00:00:00 2001
323+From: Tobias Jungel <tobias.jungel@bisdn.de>
324+Origin: upstream, https://github.com/systemd/systemd/commit/cbff717048ad25b2fb47ea3df688f9df7e6af6c7
325+Bug: https://github.com/systemd/systemd/issues/10118
326+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1833671
327+Date: Fri, 19 Oct 2018 13:12:35 +0200
328+Subject: [PATCH] networkd: keep bond slave up if already attached
329+
330+There is no need to disable an already correct enslaved interface.
331+
332+relates to #10118
333+---
334+ src/network/networkd-link.c | 8 ++++++++
335+ src/network/networkd-link.h | 1 +
336+ 2 files changed, 9 insertions(+)
337+
338+--- a/src/network/networkd-link.c
339++++ b/src/network/networkd-link.c
340+@@ -483,6 +483,10 @@
341+ return -ENOMEM;
342+ }
343+
344++ r = sd_netlink_message_read_u32(message, IFLA_MASTER, (uint32_t *)&link->master_ifindex);
345++ if (r < 0)
346++ log_link_debug_errno(link, r, "New device has no master, continuing without");
347++
348+ r = sd_netlink_message_read_ether_addr(message, IFLA_ADDRESS, &link->mac);
349+ if (r < 0)
350+ log_link_debug_errno(link, r, "MAC address not found for new device, continuing without");
351+@@ -2280,6 +2284,10 @@
352+ return link_joined(link);
353+
354+ if (link->network->bond) {
355++ if (link->network->bond->state == NETDEV_STATE_READY &&
356++ link->network->bond->ifindex == link->master_ifindex)
357++ return link_joined(link);
358++
359+ log_struct(LOG_DEBUG,
360+ LOG_LINK_INTERFACE(link),
361+ LOG_NETDEV_INTERFACE(link->network->bond),
362+--- a/src/network/networkd-link.h
363++++ b/src/network/networkd-link.h
364+@@ -67,6 +67,7 @@
365+ int n_ref;
366+
367+ int ifindex;
368++ int master_ifindex;
369+ char *ifname;
370+ char *kind;
371+ unsigned short iftype;
372diff --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
373new file mode 100644
374index 0000000..00f3af3
375--- /dev/null
376+++ b/debian/patches/lp1835581-src-network-networkd-dhcp4.c-set-prefsrc-for-classle.patch
377@@ -0,0 +1,43 @@
378+From ac2dce5f36bb8b1a877ff765e6a4dfde6bfb2d49 Mon Sep 17 00:00:00 2001
379+From: Dan Streetman <ddstreet@canonical.com>
380+Bug: https://github.com/systemd/systemd/issues/12969
381+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1835581
382+Origin: upstream, https://github.com/systemd/systemd/commit/ac2dce5f36bb8b1a877ff765e6a4dfde6bfb2d49
383+Date: Fri, 5 Jul 2019 16:42:38 -0400
384+Subject: [PATCH] src/network/networkd-dhcp4.c: set prefsrc for classless or
385+ static routes
386+
387+When a DHCP server provides only a gateway, the networkd-dhcp4 code adds a
388+default route using that gateway, and sets the just-provided address as
389+the route's prefsrc; this was added in commit
390+46b0c76e2c355c0d0cc4792abb98cde07b28bc53
391+
392+However, if the DHCP server has also provided classless route(s), these
393+are used instead of a default route using the provided gateway; the
394+networkd-dhcp4 code sets up the classless routes, but does not use the
395+just-provided dhcp address as the prefsrc of the route(s). Note that
396+it also doesn't set the prefsrc for static routes, though it should.
397+
398+If the interface has only the dhcp-provided address, this is not usually
399+a problem, but if it has another address (e.g. a static address), then
400+traffic sent through the dhcp-provided gateway might not use the
401+dhcp-provided source address. If the gateway router only will route
402+traffic from the dhcp-provided address, then the dhcp client system's
403+networking through the router will not work.
404+
405+Fixes: #12969
406+---
407+ src/network/networkd-dhcp4.c | 4 ++++
408+ 1 file changed, 4 insertions(+)
409+
410+--- a/src/network/networkd-dhcp4.c
411++++ b/src/network/networkd-dhcp4.c
412+@@ -130,6 +130,8 @@
413+ route->priority = link->network->dhcp_route_metric;
414+ route->table = table;
415+ route->scope = route_scope_from_address(route, &address);
416++ if (IN_SET(route->scope, RT_SCOPE_LINK, RT_SCOPE_UNIVERSE))
417++ route->prefsrc.in = address;
418+
419+ r = route_configure(route, link, dhcp4_route_handler);
420+ if (r < 0)
421diff --git a/debian/patches/series b/debian/patches/series
422index 40073dd..afe70cd 100644
423--- a/debian/patches/series
424+++ b/debian/patches/series
425@@ -118,3 +118,7 @@ resolved-do-not-hit-CNAME-in-NODATA.patch
426 exec-util-in-execute_directories-support-initial-exec-env.patch
427 core-execute-environment_generators-with-manager-s-enviro.patch
428 core-execute-generators-with-manager-s-environmnet.patch
429+lp1835581-src-network-networkd-dhcp4.c-set-prefsrc-for-classle.patch
430+lp1668771-resolved-switch-cache-option-to-a-tri-state-option-s.patch
431+lp1833671-networkd-keep-bond-slave-up-if-already-attached.patch
432+hwdb-revert-airplane-mode-keys-handling-on-Dell.patch

Subscribers

People subscribed via source and target branches