Merge ~enr0n/ubuntu/+source/systemd:ubuntu-lunar-next into ~ubuntu-core-dev/ubuntu/+source/systemd:ubuntu-lunar

Proposed by Nick Rosbrook
Status: Merged
Merge reported by: Lukas Märdian
Merged at revision: 1bec01746ec5b0e1613f23b3da1dfe1866af4b52
Proposed branch: ~enr0n/ubuntu/+source/systemd:ubuntu-lunar-next
Merge into: ~ubuntu-core-dev/ubuntu/+source/systemd:ubuntu-lunar
Diff against target: 120 lines (+92/-0)
4 files modified
debian/changelog (+13/-0)
debian/patches/lp2004478-network-dhcp4-accept-local-subnet-routes-from-DHCP.patch (+55/-0)
debian/patches/sd-netlink-skip-test_rtnl_set_link_name-when-altnames-are.patch (+22/-0)
debian/patches/series (+2/-0)
Reviewer Review Type Date Requested Status
Lukas Märdian Approve
Review via email: mp+438554@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Lukas Märdian (slyon) wrote (last edit ):

Okay, so this is a post feature freeze upload. It only contains a targeted fix for bug #2004478 and also a drive-by fix for the test system, which is part of a bigger PR upstream, which can be dropped after v253 lands in Ubuntu: https://github.com/systemd/systemd/pull/25986

LGTM overall.

But I had some trouble connecting the dots on d/p/sd-netlink-skip-test_rtnl_set_link_name-when-altnames-are.patch (it seemed a bit out of context). So I added some additional DEP3 headers to that patch, to make clear where it comes from and when it can be dropped exactly.

```diff
$ git diff enr0n/ubuntu-lunar-next
diff --git a/debian/changelog b/debian/changelog
index 3aaba0e14d3..bc515ad1742 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,7 +7,7 @@ systemd (252.5-2ubuntu2) lunar; urgency=medium
     This has already been fixed upstream by a larger commit, so this patch
     can be dropped when we have a new enough upstream version.
     File: debian/patches/sd-netlink-skip-test_rtnl_set_link_name-when-altnames-are.patch
- https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=d047ef91f356f3998ac46cab677e0ec4abc197da
+ https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=195985ee5aa2cfdbbac178a07e5b43b83f0550d0

  -- Nick Rosbrook <email address hidden> Wed, 08 Mar 2023 12:51:51 -0500

diff --git a/debian/patches/sd-netlink-skip-test_rtnl_set_link_name-when-altnames-are.patch b/debian/patches/sd-netlink-skip-test_rtnl_set_link_name-when-altnames-are.patch
index b0e852b94db..9ce7b03b85f 100644
--- a/debian/patches/sd-netlink-skip-test_rtnl_set_link_name-when-altnames-are.patch
+++ b/debian/patches/sd-netlink-skip-test_rtnl_set_link_name-when-altnames-are.patch
@@ -1,8 +1,13 @@
 From: Nick Rosbrook <email address hidden>
 Date: Thu, 2 Mar 2023 10:07:00 -0500
-Subject: sd-netlink: skip test_rtnl_set_link_name when altnames are not
- supported
-
+Subject: sd-netlink: skip test_rtnl_set_link_name when altnames are not supported
+Origin: vendor, Ubuntu
+Applied-Upstream: https://github.com/systemd/systemd/pull/25986 (v253)
+Acked-by: Lukas Märdian <email address hidden>
+Forwarded: not-needed
+Last-Update: 2023-03-09
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 ---
  src/libsystemd/sd-netlink/test-netlink.c | 2 ++
  1 file changed, 2 insertions(+)
```

review: Approve
Revision history for this message
Lukas Märdian (slyon) wrote :
Revision history for this message
Nick Rosbrook (enr0n) wrote :

Thanks, Lukas! Sorry about the missing DEP3 headers, and thanks for catching that.

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 2821604..3aaba0e 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,16 @@
6+systemd (252.5-2ubuntu2) lunar; urgency=medium
7+
8+ * network/dhcp4: accept local subnet routes from DHCP (LP: #2004478)
9+ File: debian/patches/lp2004478-network-dhcp4-accept-local-subnet-routes-from-DHCP.patch
10+ https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=b9aaaf37b8ca7c9febe5f0ebc4b82d0f895cbbd3
11+ * sd-netlink: skip test_rtnl_set_link_name when altnames are not supported.
12+ This has already been fixed upstream by a larger commit, so this patch
13+ can be dropped when we have a new enough upstream version.
14+ File: debian/patches/sd-netlink-skip-test_rtnl_set_link_name-when-altnames-are.patch
15+ https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=d047ef91f356f3998ac46cab677e0ec4abc197da
16+
17+ -- Nick Rosbrook <nick.rosbrook@canonical.com> Wed, 08 Mar 2023 12:51:51 -0500
18+
19 systemd (252.5-2ubuntu1) lunar; urgency=medium
20
21 * Merge 252.5-2 from Debian unstable
22diff --git a/debian/patches/lp2004478-network-dhcp4-accept-local-subnet-routes-from-DHCP.patch b/debian/patches/lp2004478-network-dhcp4-accept-local-subnet-routes-from-DHCP.patch
23new file mode 100644
24index 0000000..1e75694
25--- /dev/null
26+++ b/debian/patches/lp2004478-network-dhcp4-accept-local-subnet-routes-from-DHCP.patch
27@@ -0,0 +1,55 @@
28+From: Tuetuopay <tuetuopay@me.com>
29+Date: Fri, 27 Jan 2023 15:10:49 +0100
30+Subject: network/dhcp4: accept local subnet routes from DHCP
31+
32+Origin: upstream, https://github.com/systemd/systemd-stable/commit/b0f514ba567a1f6321f6b7f1ded038f8090c70f0
33+Bug-Ubuntu: https://launchpad.net/bugs/2004478
34+
35+RFC3442 specifies option 121 (Classless Static Routes) that allow a DHCP
36+server to push arbitrary routes to a client. It has a Local Subnet
37+Routes section expliciting the behavior of routes with a null (0.0.0.0)
38+gateway.
39+
40+Such routes are to be installed on the interface with a Link scope, to
41+mark them as directly available on the link without any gateway.
42+
43+Networkd currently drops those routes, which is against the RFC, as
44+Linux has proper support for such routes.
45+
46+Fixes: 7f20627 ("network: dhcp4: ignore gateway in static routes if destination is link-local or in the same network")
47+(cherry picked from commit 1d84a3c7792a8910b05904937c703307ca19740f)
48+---
49+ src/network/networkd-dhcp4.c | 19 +++++++++++--------
50+ 1 file changed, 11 insertions(+), 8 deletions(-)
51+
52+diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
53+index c5bddb6..9a22b6f 100644
54+--- a/src/network/networkd-dhcp4.c
55++++ b/src/network/networkd-dhcp4.c
56+@@ -334,15 +334,18 @@ static int dhcp4_request_route_auto(
57+ route->gw = IN_ADDR_NULL;
58+ route->prefsrc.in = address;
59+
60+- } else {
61+- if (in4_addr_is_null(gw)) {
62+- log_link_debug(link, "DHCP: requested route destination "IPV4_ADDRESS_FMT_STR"/%u is not in the assigned network "
63+- IPV4_ADDRESS_FMT_STR"/%u, but no gateway is specified, ignoring.",
64+- IPV4_ADDRESS_FMT_VAL(route->dst.in), route->dst_prefixlen,
65+- IPV4_ADDRESS_FMT_VAL(prefix), prefixlen);
66+- return 0;
67+- }
68++ } else if (in4_addr_is_null(gw)) {
69++ log_link_debug(link, "DHCP: requested route destination "IPV4_ADDRESS_FMT_STR"/%u is not in the assigned network "
70++ IPV4_ADDRESS_FMT_STR"/%u, but no gateway is specified, using 'link' scope.",
71++ IPV4_ADDRESS_FMT_VAL(route->dst.in), route->dst_prefixlen,
72++ IPV4_ADDRESS_FMT_VAL(prefix), prefixlen);
73+
74++ route->scope = RT_SCOPE_LINK;
75++ route->gw_family = AF_UNSPEC;
76++ route->gw = IN_ADDR_NULL;
77++ route->prefsrc.in = address;
78++
79++ } else {
80+ r = dhcp4_request_route_to_gateway(link, gw);
81+ if (r < 0)
82+ return r;
83diff --git a/debian/patches/sd-netlink-skip-test_rtnl_set_link_name-when-altnames-are.patch b/debian/patches/sd-netlink-skip-test_rtnl_set_link_name-when-altnames-are.patch
84new file mode 100644
85index 0000000..b0e852b
86--- /dev/null
87+++ b/debian/patches/sd-netlink-skip-test_rtnl_set_link_name-when-altnames-are.patch
88@@ -0,0 +1,22 @@
89+From: Nick Rosbrook <nick.rosbrook@canonical.com>
90+Date: Thu, 2 Mar 2023 10:07:00 -0500
91+Subject: sd-netlink: skip test_rtnl_set_link_name when altnames are not
92+ supported
93+
94+---
95+ src/libsystemd/sd-netlink/test-netlink.c | 2 ++
96+ 1 file changed, 2 insertions(+)
97+
98+diff --git a/src/libsystemd/sd-netlink/test-netlink.c b/src/libsystemd/sd-netlink/test-netlink.c
99+index 2d93f9e..736252d 100644
100+--- a/src/libsystemd/sd-netlink/test-netlink.c
101++++ b/src/libsystemd/sd-netlink/test-netlink.c
102+@@ -685,6 +685,8 @@ static void test_rtnl_set_link_name(sd_netlink *rtnl, int ifindex) {
103+ r = rtnl_set_link_alternative_names(&rtnl, ifindex, STRV_MAKE("testlongalternativename"));
104+ if (r == -EPERM)
105+ return (void) log_tests_skipped("missing required capabilities");
106++ if (r == -EOPNOTSUPP)
107++ return (void) log_tests_skipped("alternative name is not supported");
108+
109+ assert_se(r >= 0);
110+ assert_se(rtnl_set_link_name(&rtnl, ifindex, "testlongalternativename") == -EINVAL);
111diff --git a/debian/patches/series b/debian/patches/series
112index 654d909..749ad23 100644
113--- a/debian/patches/series
114+++ b/debian/patches/series
115@@ -51,3 +51,5 @@ lp2002445-udev-attempt-device-rename-even-if-interface-is-up.patch
116 lp2002445-sd-netlink-add-a-test-for-rtnl_set_link_name.patch
117 lp2002445-test-network-add-a-test-for-renaming-device-to-current-al.patch
118 Deny-list-TEST-74-AUX-UTILS-on-s390x.patch
119+lp2004478-network-dhcp4-accept-local-subnet-routes-from-DHCP.patch
120+sd-netlink-skip-test_rtnl_set_link_name-when-altnames-are.patch

Subscribers

People subscribed via source and target branches