diff -Nru systemd-237/debian/changelog systemd-237/debian/changelog --- systemd-237/debian/changelog 2019-03-21 08:58:19.000000000 +0000 +++ systemd-237/debian/changelog 2019-03-13 06:42:11.000000000 +0000 @@ -1,9 +1,3 @@ -systemd (237-3ubuntu10.17) bionic; urgency=medium - - * Fix RoutingPolicyRule does not apply correctly (LP: #1818282) - - -- Ioanna Alifieraki Thu, 21 Mar 2019 08:58:19 +0000 - systemd (237-3ubuntu10.16) bionic; urgency=medium * d/p/Support-system-image-read-only-etc.patch: diff -Nru systemd-237/debian/patches/backport_fix-return-value-of-routing_policy_rule_get.patch systemd-237/debian/patches/backport_fix-return-value-of-routing_policy_rule_get.patch --- systemd-237/debian/patches/backport_fix-return-value-of-routing_policy_rule_get.patch 2019-03-21 08:55:47.000000000 +0000 +++ systemd-237/debian/patches/backport_fix-return-value-of-routing_policy_rule_get.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,35 +0,0 @@ -Description: Fix return value of routing_policy_rule_get -This patch backports upstream commit e6b65ab76073338a620a0c425d4b17f2281c1eb0. -Needed to address LP: #1818282 (upstream issue 11280). - -Origin: upstream, https://github.com/systemd/systemd/commit/e6b65ab76073338a620 -Bug: https://github.com/systemd/systemd/issues/11280 -Bug-Ubuntu: https://launchpad.net/bugs/1818282 ---- - -Index: systemd-237/src/network/networkd-link.c -=================================================================== ---- systemd-237.orig/src/network/networkd-link.c -+++ systemd-237/src/network/networkd-link.c -@@ -804,7 +804,7 @@ static int link_set_routing_policy_rule( - LIST_FOREACH(rules, rule, link->network->rules) { - r = routing_policy_rule_get(link->manager, rule->family, &rule->from, rule->from_prefixlen, &rule->to, - rule->to_prefixlen, rule->tos, rule->fwmark, rule->table, rule->iif, rule->oif, &rrule); -- if (r == 1) { -+ if (r == 0) { - (void) routing_policy_rule_make_local(link->manager, rrule); - continue; - } -Index: systemd-237/src/network/networkd-routing-policy-rule.c -=================================================================== ---- systemd-237.orig/src/network/networkd-routing-policy-rule.c -+++ systemd-237/src/network/networkd-routing-policy-rule.c -@@ -212,7 +212,7 @@ int routing_policy_rule_get(Manager *m, - if (existing) { - if (ret) - *ret = existing; -- return 1; -+ return 0; - } - } - diff -Nru systemd-237/debian/patches/backport_network-do-not-remove-rule-when-requested-by-existing-links.patch systemd-237/debian/patches/backport_network-do-not-remove-rule-when-requested-by-existing-links.patch --- systemd-237/debian/patches/backport_network-do-not-remove-rule-when-requested-by-existing-links.patch 2019-03-21 08:58:10.000000000 +0000 +++ systemd-237/debian/patches/backport_network-do-not-remove-rule-when-requested-by-existing-links.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,52 +0,0 @@ -Description: Do not remove rule when required by existing link -This patch backports upstream commit 031fb59a984e5b51f3c72aa8125ecc50b08011fe - -Origin: upstream, https://github.com/systemd/systemd/pull/11795/commits/031fb59a984e5b51f3c72aa8125ecc50b08011fe -Bug: https://github.com/systemd/systemd/issues/11280 -Bug-Ubuntu: https://launchpad.net/bugs/1818282 ---- - -Index: systemd-237/src/network/networkd-routing-policy-rule.c -=================================================================== ---- systemd-237.orig/src/network/networkd-routing-policy-rule.c -+++ systemd-237/src/network/networkd-routing-policy-rule.c -@@ -1045,6 +1045,26 @@ int routing_policy_load_rules(const char - return 0; - } - -+static bool manager_links_have_routing_policy_rule(Manager *m, RoutingPolicyRule *rule) { -+ RoutingPolicyRule *link_rule; -+ Iterator i; -+ Link *link; -+ -+ assert(m); -+ assert(rule); -+ -+ HASHMAP_FOREACH(link, m->links, i) { -+ if (!link->network) -+ continue; -+ -+ LIST_FOREACH(rules, link_rule, link->network->rules) -+ if (routing_policy_rule_compare_func(link_rule, rule) == 0) -+ return true; -+ } -+ -+ return false; -+} -+ - void routing_policy_rule_purge(Manager *m, Link *link) { - RoutingPolicyRule *rule, *existing; - Iterator i; -@@ -1058,6 +1078,12 @@ void routing_policy_rule_purge(Manager * - if (!existing) - continue; /* Saved rule does not exist anymore. */ - -+ if (manager_links_have_routing_policy_rule(m, existing)) -+ continue; /* Existing links have the saved rule. */ -+ -+ /* Existing links do not have the saved rule. Let's drop the -+ * rule now, and re-configure it later when it is requested. */ -+ - r = routing_policy_rule_remove(rule, link, routing_policy_rule_remove_handler); - if (r < 0) { - log_warning_errno(r, "Could not remove routing policy rules: %m"); diff -Nru systemd-237/debian/patches/backport_network-remove-routing-policy-rule-from-foreign.patch systemd-237/debian/patches/backport_network-remove-routing-policy-rule-from-foreign.patch --- systemd-237/debian/patches/backport_network-remove-routing-policy-rule-from-foreign.patch 2019-03-21 08:57:41.000000000 +0000 +++ systemd-237/debian/patches/backport_network-remove-routing-policy-rule-from-foreign.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,39 +0,0 @@ -Description: Remove routing policy rule from foreign rule database -This patch backports upstream commit 92cd00b9749141907a1110044cc7d1f01caff545 - -Origin: upstream, https://github.com/systemd/systemd/pull/11795/commits/92cd00b9749141907a1110044cc7d1f01caff545 -Bug: https://github.com/systemd/systemd/issues/11280 -Bug-Ubuntu: https://launchpad.net/bugs/1818282 ---- - -Index: systemd-237/src/network/networkd-routing-policy-rule.c -=================================================================== ---- systemd-237.orig/src/network/networkd-routing-policy-rule.c -+++ systemd-237/src/network/networkd-routing-policy-rule.c -@@ -1055,15 +1055,18 @@ void routing_policy_rule_purge(Manager * - - SET_FOREACH(rule, m->rules_saved, i) { - existing = set_get(m->rules_foreign, rule); -- if (existing) { -+ if (!existing) -+ continue; /* Saved rule does not exist anymore. */ - -- r = routing_policy_rule_remove(rule, link, routing_policy_rule_remove_handler); -- if (r < 0) { -- log_warning_errno(r, "Could not remove routing policy rules: %m"); -- continue; -- } -- -- link->routing_policy_rule_remove_messages++; -+ r = routing_policy_rule_remove(rule, link, routing_policy_rule_remove_handler); -+ if (r < 0) { -+ log_warning_errno(r, "Could not remove routing policy rules: %m"); -+ continue; - } -+ -+ link->routing_policy_rule_remove_messages++; -+ -+ assert_se(set_remove(m->rules_foreign, existing) == existing); -+ routing_policy_rule_free(existing); - } - } diff -Nru systemd-237/debian/patches/series systemd-237/debian/patches/series --- systemd-237/debian/patches/series 2019-03-21 08:57:57.000000000 +0000 +++ systemd-237/debian/patches/series 2019-03-13 06:42:11.000000000 +0000 @@ -99,6 +99,3 @@ stop-mount-error-propagation.patch fix-race-daemon-reload-8803.patch Support-system-image-read-only-etc.patch -backport_fix-return-value-of-routing_policy_rule_get.patch -backport_network-remove-routing-policy-rule-from-foreign.patch -backport_network-do-not-remove-rule-when-requested-by-existing-links.patch