diff options
author | Thomas Haller <thaller@redhat.com> | 2016-08-17 21:55:23 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-08-17 22:31:09 +0200 |
commit | ac5dc1a9510c086c54c365b1160a51cc25402010 (patch) | |
tree | 9b337ddbd82a93f2bda753c022fdd113c2221b3c | |
parent | 5e41e1634d1c2495629616a3d7bd42f5fc33ee9d (diff) | |
download | NetworkManager-ac5dc1a9510c086c54c365b1160a51cc25402010.tar.gz |
core: don't suppress routes inside the subnet of the interface
It's not clear why a route should be suppressed if it is contained
in the subnet of one of the interface's addresses.
I think it is wrong to do this. For example, imagine an ethernet
and a Wi-Fi device both connected to the same subnet 10.0.0.0/8. By
default, ethernet gets higher priority and a better metric of 100.
If the user wants to configure a route "10.0.0.1/32 metric 99"
to reach a certain host explicitly via Wi-Fi, this check will
forbid that.
This condition was added a long time ago (38dbdae26606f984f1d12c8a56ed27bc1b4d9c20),
but it's unclear what the original intent was.
See also commit 4f7b1cabc063bfda96cb5c129d6a233e5d5cff68, which
already relaxed this suppression of routes for non-direct routes.
-rw-r--r-- | src/nm-ip4-config.c | 8 | ||||
-rw-r--r-- | src/nm-ip6-config.c | 8 |
2 files changed, 0 insertions, 16 deletions
diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c index c52d7cd937..7ef9fc5bb5 100644 --- a/src/nm-ip4-config.c +++ b/src/nm-ip4-config.c @@ -420,14 +420,6 @@ nm_ip4_config_commit (const NMIP4Config *config, int ifindex, gboolean routes_fu const NMPlatformIP4Route *route; route = nm_ip4_config_get_route (config, i); - - /* Don't add the route if it's more specific than one of the subnets - * the device already has an IP address on. - */ - if ( route->gateway == 0 - && nm_ip4_config_destination_is_direct (config, route->network, route->plen)) - continue; - /* duplicates in @routes are no problem as route-manager handles them * gracefully (by ignoring them). */ g_array_append_vals (routes, route, 1); diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index 7077a5354c..83cd8af0c2 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -412,14 +412,6 @@ nm_ip6_config_commit (const NMIP6Config *config, int ifindex, gboolean routes_fu for (i = 0; i < count; i++) { route = nm_ip6_config_get_route (config, i); - - /* Don't add the route if it's more specific than one of the subnets - * the device already has an IP address on. - */ - if ( IN6_IS_ADDR_UNSPECIFIED (&route->gateway) - && nm_ip6_config_destination_is_direct (config, &route->network, route->plen)) - continue; - g_array_append_vals (routes, route, 1); } |