mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-03 18:17:59 +02:00
route-manager: refactor: a readability improvement
(cherry picked from commit 6c5d93b847)
This commit is contained in:
parent
449a5c28ba
commit
7d1d5b160b
1 changed files with 4 additions and 2 deletions
|
|
@ -183,7 +183,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;
|
||||
|
|
@ -304,7 +305,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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue