diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2012-08-10 11:21:26 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-08-10 17:08:33 +0300 |
commit | 665eff90e5908188906f7d8b55bfe4eba28eaff2 (patch) | |
tree | c287162cee1f974e65bfd25868495b0dc0d5efed /src/dhcp.c | |
parent | 8042d16be5b0f4556f502be949271d14903e7a7d (diff) | |
download | connman-665eff90e5908188906f7d8b55bfe4eba28eaff2.tar.gz connman-665eff90e5908188906f7d8b55bfe4eba28eaff2.tar.bz2 connman-665eff90e5908188906f7d8b55bfe4eba28eaff2.zip |
dhcp: Apply received hostname option according to conf file setting
We do not use the received DHCP hostname option (12) if system
config file setting says so.
Fixes BMC#25597
Diffstat (limited to 'src/dhcp.c')
-rw-r--r-- | src/dhcp.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -28,6 +28,7 @@ #include <stdlib.h> #include <connman/ipconfig.h> +#include <include/setting.h> #include <gdhcp/gdhcp.h> @@ -258,9 +259,12 @@ static void lease_available_cb(GDHCPClient *dhcp_client, gpointer user_data) if (option != NULL) domainname = g_strdup(option->data); - option = g_dhcp_client_get_option(dhcp_client, G_DHCP_HOST_NAME); - if (option != NULL) - hostname = g_strdup(option->data); + if (connman_setting_get_bool("AllowHostnameUpdates") == TRUE) { + option = g_dhcp_client_get_option(dhcp_client, + G_DHCP_HOST_NAME); + if (option != NULL) + hostname = g_strdup(option->data); + } option = g_dhcp_client_get_option(dhcp_client, G_DHCP_NTP_SERVER); ns_entries = g_list_length(option); |