diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2015-03-09 14:12:00 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2015-03-09 14:13:02 +0100 |
commit | 6c5d93b84785a7139e99a3e6a5f1ea7ed5649bc7 (patch) | |
tree | 8b91e206808e8afb7c6d605370e59ed51debf276 | |
parent | 6b5de0ab5f2caedabb0e516c2a26b86c0f0b1002 (diff) | |
download | NetworkManager-6c5d93b84785a7139e99a3e6a5f1ea7ed5649bc7.tar.gz |
route-manager: refactor: a readability improvement
-rw-r--r-- | src/nm-route-manager.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nm-route-manager.c b/src/nm-route-manager.c index 3f9eb1be2d..0e1c48c2da 100644 --- a/src/nm-route-manager.c +++ b/src/nm-route-manager.c @@ -181,7 +181,8 @@ nm_route_manager_ip4_route_sync (NMRouteManager *self, int ifindex, const GArray 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; @@ -299,7 +300,8 @@ nm_route_manager_ip6_route_sync (NMRouteManager *self, int ifindex, const GArray 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; |