summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-10-15 23:14:30 +0200
committerThomas Haller <thaller@redhat.com>2014-10-15 23:25:20 +0200
commit42369601e0b4e41664ec54cd1767f08ad9b0cb3b (patch)
treea12b8ee39476a41e643fe9fe1d77cc568bbfbcfc
parent593846bfa39ddc880a0e8d2b0944511aff72a568 (diff)
downloadNetworkManager-th/bgo738590_dhcp_server_route.tar.gz
dhcp: don't add special route to DHCP server when having direct routeth/bgo738590_dhcp_server_route
When the DHCP server address is not on the same subnet, we used to add a /32 route to the server IP address via the gateway. Do not add this route, if we already got a direct route from DHCP. https://bugzilla.gnome.org/show_bug.cgi?id=738590 Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r--src/dhcp-manager/nm-dhcp-utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dhcp-manager/nm-dhcp-utils.c b/src/dhcp-manager/nm-dhcp-utils.c
index c017f6cfb3..be0da80273 100644
--- a/src/dhcp-manager/nm-dhcp-utils.c
+++ b/src/dhcp-manager/nm-dhcp-utils.c
@@ -455,7 +455,8 @@ nm_dhcp_utils_ip4_config_from_options (const char *iface,
guint32 mask = nm_utils_ip4_prefix_to_netmask (address.plen);
nm_log_info (LOGD_DHCP4, " server identifier %s", str);
- if ((tmp_addr & mask) != (address.address & mask)) {
+ if ( (tmp_addr & mask) != (address.address & mask)
+ && !nm_ip4_config_get_direct_route_for_host (ip4_config, tmp_addr)) {
/* DHCP server not on assigned subnet, route needed */
memset (&route, 0, sizeof (route));
route.network = tmp_addr;