From fe9dada57aad2e46662ee976b994c06e3cfdc8e0 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Mon, 9 Mar 2015 14:12:00 +0100 Subject: [PATCH] route-manager: refactor: a readability improvement (cherry picked from commit 6c5d93b84785a7139e99a3e6a5f1ea7ed5649bc7) Conflicts: src/nm-route-manager.c --- src/platform/nm-platform.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c index 1340fc9a9e..ffa21d2a94 100644 --- a/src/platform/nm-platform.c +++ b/src/platform/nm-platform.c @@ -2101,7 +2101,8 @@ nm_platform_ip4_route_sync (int ifindex, const GArray *known_routes) if (NM_PLATFORM_IP_ROUTE_IS_DEFAULT (known_route)) continue; - if ((known_route->gateway == 0) ^ (i_type == 0)) { + if ( (i_type == 0 && known_route->gateway != 0) + || (i_type == 1 && known_route->gateway == 0)) { /* Make two runs over the list of routes. On the first, only add * device routes, on the second the others (gateway routes). */ continue; @@ -2175,7 +2176,8 @@ nm_platform_ip6_route_sync (int ifindex, const GArray *known_routes) if (NM_PLATFORM_IP_ROUTE_IS_DEFAULT (known_route)) continue; - if (IN6_IS_ADDR_UNSPECIFIED (&known_route->gateway) ^ (i_type == 0)) { + if ( (i_type == 0 && !IN6_IS_ADDR_UNSPECIFIED (&known_route->gateway)) + || (i_type == 1 && IN6_IS_ADDR_UNSPECIFIED (&known_route->gateway))) { /* Make two runs over the list of routes. On the first, only add * device routes, on the second the others (gateway routes). */ continue;