@@ -61,6 +61,7 @@ struct connman_dhcp {
char *dhcp_debug_prefix;
bool ipv4ll_running;
+ bool omit_client_identifier;
};
static GHashTable *ipconfig_table;
@@ -209,7 +210,9 @@ static int ipv4ll_start_client(struct connman_dhcp *dhcp)
dhcp->ipv4ll_debug_prefix);
}
- g_dhcp_client_set_id(ipv4ll_client);
+ if ( !dhcp->omit_client_identifier ) {
+ g_dhcp_client_set_id(ipv4ll_client);
+ }
if (dhcp->network) {
hostname = connman_utsname_get_hostname();
@@ -572,6 +575,7 @@ static int dhcp_initialize(struct connman_dhcp *dhcp)
GDHCPClientError error;
int index;
const char *vendor_class_id;
+ const char *omit_client_id;
DBG("dhcp %p", dhcp);
@@ -588,7 +592,17 @@ static int dhcp_initialize(struct connman_dhcp *dhcp)
dhcp->dhcp_debug_prefix);
}
- g_dhcp_client_set_id(dhcp_client);
+ omit_client_id = connman_setting_get_string("OmitClientIdentifier");
+ if ( omit_client_id && g_str_equal(omit_client_id,"true" ) ) {
+ dhcp->omit_client_identifier = true;
+ }
+ else {
+ dhcp->omit_client_identifier = false;
+ }
+
+ if ( ! dhcp->omit_client_identifier ) {
+ g_dhcp_client_set_id(dhcp_client);
+ }
if (dhcp->network) {
struct connman_service *service;
@@ -107,6 +107,7 @@ static struct {
bool persistent_tethering_mode;
bool enable_6to4;
char *vendor_class_id;
+ char *omit_client_id;
bool enable_online_check;
bool enable_online_to_ready_transition;
char *online_check_ipv4_url;
@@ -139,6 +140,7 @@ static struct {
.persistent_tethering_mode = false,
.enable_6to4 = false,
.vendor_class_id = NULL,
+ .omit_client_id = NULL,
.enable_online_check = true,
.enable_online_to_ready_transition = false,
.online_check_ipv4_url = NULL,
@@ -171,6 +173,7 @@ static struct {
#define CONF_PERSISTENT_TETHERING_MODE "PersistentTetheringMode"
#define CONF_ENABLE_6TO4 "Enable6to4"
#define CONF_VENDOR_CLASS_ID "VendorClassID"
+#define CONF_OMIT_CLIENT_ID "OmitClientIdentifier"
#define CONF_ENABLE_ONLINE_CHECK "EnableOnlineCheck"
#define CONF_ENABLE_ONLINE_TO_READY_TRANSITION "EnableOnlineToReadyTransition"
#define CONF_ONLINE_CHECK_IPV4_URL "OnlineCheckIPv4URL"
@@ -204,6 +207,7 @@ static const char *supported_options[] = {
CONF_PERSISTENT_TETHERING_MODE,
CONF_ENABLE_6TO4,
CONF_VENDOR_CLASS_ID,
+ CONF_OMIT_CLIENT_ID,
CONF_ENABLE_ONLINE_CHECK,
CONF_ENABLE_ONLINE_TO_READY_TRANSITION,
CONF_ONLINE_CHECK_IPV4_URL,
@@ -518,6 +522,15 @@ static void parse_config(GKeyFile *config)
g_clear_error(&error);
+ string = __connman_config_get_string(config, "General",
+ CONF_OMIT_CLIENT_ID, &error);
+ if (!error) {
+ connman_settings.omit_client_id = string;
+ connman_info("OMIT_CLIENT_ID: %s\n",string);
+ }
+
+ g_clear_error(&error);
+
boolean = __connman_config_get_bool(config, "General",
CONF_ENABLE_ONLINE_CHECK, &error);
if (!error) {
@@ -843,6 +856,9 @@ char *connman_setting_get_string(const char *key)
if (g_str_equal(key, CONF_VENDOR_CLASS_ID))
return connman_settings.vendor_class_id;
+ if (g_str_equal(key, CONF_OMIT_CLIENT_ID))
+ return connman_settings.omit_client_id;
+
if (g_str_equal(key, CONF_ONLINE_CHECK_IPV4_URL))
return connman_settings.online_check_ipv4_url;
@@ -1146,6 +1162,7 @@ int main(int argc, char *argv[])
g_strfreev(connman_settings.blacklisted_interfaces);
g_strfreev(connman_settings.tethering_technologies);
g_free(connman_settings.vendor_class_id);
+ g_free(connman_settings.omit_client_id);
g_free(connman_settings.online_check_ipv4_url);
g_free(connman_settings.online_check_ipv6_url);
g_free(connman_settings.localtime);
* add "OmitClientIdenfier" option to main.conf, which causes the DHCP client to not include the option 61 (Client Identifier) in DHCP packets. Signed-off-by: António Oliveira <antonio.oliveira@konsulko.com> --- src/dhcp.c | 18 ++++++++++++++++-- src/main.c | 17 +++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-)