]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: unbreak routing_policy_rule_compare_func() 13583/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 17 Sep 2019 17:27:58 +0000 (19:27 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 17 Sep 2019 17:27:58 +0000 (19:27 +0200)
!r is the same r == 0, so this was short-circuiting the comparison when
streq(a->iff, b->iff) or streq(a->off, b->off). Before the parent commit which
moved those comparisons to the end, this was short-circuiting quite a bit
of the comparison function.

src/network/networkd-routing-policy-rule.c

index 1c2c28b02ac646ba136df161487d5a18922e2aeb..8203f87c9faa1a33a696efcddc72030bbe288469 100644 (file)
@@ -199,11 +199,11 @@ static int routing_policy_rule_compare_func(const RoutingPolicyRule *a, const Ro
                         return r;
 
                 r = strcmp_ptr(a->iif, b->iif);
-                if (!r)
+                if (r != 0)
                         return r;
 
                 r = strcmp_ptr(a->oif, b->oif);
-                if (!r)
+                if (r != 0)
                         return r;
 
                 return 0;