diff -Nru systemd-237/debian/changelog systemd-237/debian/changelog --- systemd-237/debian/changelog 2019-08-29 22:30:33.000000000 +0000 +++ systemd-237/debian/changelog 2019-09-05 03:59:51.000000000 +0000 @@ -1,3 +1,12 @@ +systemd (237-3ubuntu10.29) bionic; urgency=medium + + * d/p/d/Revert-udev-network-device-renaming-immediately-give.patch: + - udev: add Revert-udev-network-device-renaming-immediately-give.patch back + Dropping this patch will cause the persistent network regression. + (LP: #1842651) + + -- Shih-Yuan Lee (FourDollars) Thu, 05 Sep 2019 11:59:51 +0800 + systemd (237-3ubuntu10.28) bionic-security; urgency=medium * SECURITY UPDATE: Unprivileged users are granted access to privileged diff -Nru systemd-237/debian/patches/debian/Revert-udev-network-device-renaming-immediately-give.patch systemd-237/debian/patches/debian/Revert-udev-network-device-renaming-immediately-give.patch --- systemd-237/debian/patches/debian/Revert-udev-network-device-renaming-immediately-give.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-237/debian/patches/debian/Revert-udev-network-device-renaming-immediately-give.patch 2019-09-05 03:59:51.000000000 +0000 @@ -0,0 +1,75 @@ +From: Michael Biebl +Date: Thu, 18 Jul 2013 01:04:07 +0200 +Subject: Revert "udev: network device renaming - immediately give up if the + target name isn't available" + +This reverts commit 97595710b77aa162ca5e20da57d0a1ed7355eaad. + +We need to keep supporting systems with 75-persistent-net-generator.rules +generated names for a while after switching to net.ifnames. Re-apply this old +hack to make the renaming less likely to fail. +--- + src/udev/udev-event.c | 41 ++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 38 insertions(+), 3 deletions(-) + +diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c +index d0befba..c3ed2da 100644 +--- a/src/udev/udev-event.c ++++ b/src/udev/udev-event.c +@@ -832,18 +832,53 @@ static int rename_netif(struct udev_event *event) { + char name[IFNAMSIZ]; + const char *oldname; + int r; ++ int loop; + + oldname = udev_device_get_sysname(dev); + + strscpy(name, IFNAMSIZ, event->name); + ++ r = rtnl_set_link_name(&event->rtnl, udev_device_get_ifindex(dev), name); ++ if (r >= 0) { ++ log_debug("renamed network interface %s to %s\n", oldname, name); ++ goto out; ++ } ++ ++ /* keep trying if the destination interface name already exists */ ++ if (r != -EEXIST) ++ goto out; ++ ++ /* free our own name, another process may wait for us */ ++ snprintf(name, IFNAMSIZ, "rename%u", udev_device_get_ifindex(dev)); + r = rtnl_set_link_name(&event->rtnl, udev_device_get_ifindex(dev), name); + if (r < 0) +- return log_error_errno(r, "Error changing net interface name '%s' to '%s': %m", oldname, name); ++ goto out; + +- log_debug("renamed network interface '%s' to '%s'", oldname, name); ++ /* log temporary name */ ++ log_debug("renamed network interface %s to %s\n", oldname, name); + +- return 0; ++ /* wait a maximum of 90 seconds for our target to become available */ ++ strscpy(name, IFNAMSIZ, event->name); ++ loop = 90 * 20; ++ while (loop--) { ++ const struct timespec duration = { 0, 1000 * 1000 * 1000 / 20 }; ++ ++ nanosleep(&duration, NULL); ++ ++ r = rtnl_set_link_name(&event->rtnl, udev_device_get_ifindex(dev), name); ++ if (r >= 0) { ++ log_debug("renamed network interface %s to %s\n", oldname, name); ++ break; ++ } ++ if (r != -EEXIST) ++ break; ++ } ++ ++out: ++ if (r < 0) ++ log_error("error changing net interface name '%s' to '%s': %s", ++ oldname, name, strerror(-r)); ++ return r; + } + + void udev_event_execute_rules(struct udev_event *event, diff -Nru systemd-237/debian/patches/series systemd-237/debian/patches/series --- systemd-237/debian/patches/series 2019-08-29 22:30:33.000000000 +0000 +++ systemd-237/debian/patches/series 2019-09-05 03:59:51.000000000 +0000 @@ -42,6 +42,7 @@ debian/Add-note-to-udev.conf-that-changes-to-that-file-requ.patch debian/Bring-tmpfiles.d-tmp.conf-in-line-with-Debian-defaul.patch debian/Make-run-lock-tmpfs-an-API-fs.patch +debian/Revert-udev-network-device-renaming-immediately-give.patch debian/Add-support-for-TuxOnIce-hibernation.patch debian/Include-additional-directories-in-ProtectSystem.patch debian/Re-enable-journal-forwarding-to-syslog.patch