summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2017-04-26 11:49:30 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2017-05-09 22:42:29 +0200
commit099b790d2bd4d4968c27c0cfdfef1be4db98c525 (patch)
treed492b464ee75a5dff659ee6703f623bc6d7184fd
parentf4226e750f3c0f0ab3dda5355b45ee0a7cb7d0b7 (diff)
downloadNetworkManager-099b790d2bd4d4968c27c0cfdfef1be4db98c525.tar.gz
dhcp: simplify how hostname and FQDN are passed down to backends
Since they are mutually exclusive, pass a string and a boolean to indicate whether we want to use the hostname or the FQDN option. (cherry picked from commit d286aa9dfa9626234e7f40705c5313407177c431)
-rw-r--r--src/devices/nm-device.c13
-rw-r--r--src/dhcp/nm-dhcp-client.c16
-rw-r--r--src/dhcp/nm-dhcp-client.h4
-rw-r--r--src/dhcp/nm-dhcp-dhclient-utils.c42
-rw-r--r--src/dhcp/nm-dhcp-dhclient-utils.h2
-rw-r--r--src/dhcp/nm-dhcp-dhclient.c17
-rw-r--r--src/dhcp/nm-dhcp-dhcpcd.c35
-rw-r--r--src/dhcp/nm-dhcp-manager.c18
-rw-r--r--src/dhcp/nm-dhcp-systemd.c41
-rw-r--r--src/dhcp/tests/test-dhcp-dhclient.c42
10 files changed, 116 insertions, 114 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 9eb36ca57f..aa7f13f9e8 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -12207,7 +12207,7 @@ nm_device_spawn_iface_helper (NMDevice *self)
g_ptr_array_add (argv, g_strdup ("--dhcp4-required"));
if (priv->dhcp4.client) {
- const char *hostname, *fqdn;
+ const char *hostname;
GBytes *client_id;
client_id = nm_dhcp_client_get_client_id (priv->dhcp4.client);
@@ -12221,15 +12221,12 @@ nm_device_spawn_iface_helper (NMDevice *self)
hostname = nm_dhcp_client_get_hostname (priv->dhcp4.client);
if (hostname) {
- g_ptr_array_add (argv, g_strdup ("--dhcp4-hostname"));
+ if (nm_dhcp_client_get_use_fqdn (priv->dhcp4.client))
+ g_ptr_array_add (argv, g_strdup ("--dhcp4-fqdn"));
+ else
+ g_ptr_array_add (argv, g_strdup ("--dhcp4-hostname"));
g_ptr_array_add (argv, g_strdup (hostname));
}
-
- fqdn = nm_dhcp_client_get_fqdn (priv->dhcp4.client);
- if (fqdn) {
- g_ptr_array_add (argv, g_strdup ("--dhcp4-fqdn"));
- g_ptr_array_add (argv, g_strdup (fqdn));
- }
}
configured = TRUE;
diff --git a/src/dhcp/nm-dhcp-client.c b/src/dhcp/nm-dhcp-client.c
index 17986aa825..0906f5beba 100644
--- a/src/dhcp/nm-dhcp-client.c
+++ b/src/dhcp/nm-dhcp-client.c
@@ -68,7 +68,7 @@ typedef struct _NMDhcpClientPrivate {
GByteArray * duid;
GBytes * client_id;
char * hostname;
- char * fqdn;
+ gboolean use_fqdn;
NMDhcpState state;
pid_t pid;
@@ -186,12 +186,12 @@ nm_dhcp_client_get_hostname (NMDhcpClient *self)
return NM_DHCP_CLIENT_GET_PRIVATE (self)->hostname;
}
-const char *
-nm_dhcp_client_get_fqdn (NMDhcpClient *self)
+gboolean
+nm_dhcp_client_get_use_fqdn (NMDhcpClient *self)
{
- g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL);
+ g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), FALSE);
- return NM_DHCP_CLIENT_GET_PRIVATE (self)->fqdn;
+ return NM_DHCP_CLIENT_GET_PRIVATE (self)->use_fqdn;
}
/*****************************************************************************/
@@ -416,7 +416,7 @@ nm_dhcp_client_start_ip4 (NMDhcpClient *self,
const char *dhcp_client_id,
const char *dhcp_anycast_addr,
const char *hostname,
- const char *fqdn,
+ gboolean use_fqdn,
const char *last_ip4_address)
{
NMDhcpClientPrivate *priv;
@@ -437,8 +437,7 @@ nm_dhcp_client_start_ip4 (NMDhcpClient *self,
g_clear_pointer (&priv->hostname, g_free);
priv->hostname = g_strdup (hostname);
- g_free (priv->fqdn);
- priv->fqdn = g_strdup (fqdn);
+ priv->use_fqdn = use_fqdn;
return NM_DHCP_CLIENT_GET_CLASS (self)->ip4_start (self, dhcp_anycast_addr, last_ip4_address);
}
@@ -911,7 +910,6 @@ dispose (GObject *object)
g_clear_pointer (&priv->iface, g_free);
g_clear_pointer (&priv->hostname, g_free);
- g_clear_pointer (&priv->fqdn, g_free);
g_clear_pointer (&priv->uuid, g_free);
g_clear_pointer (&priv->client_id, g_bytes_unref);
diff --git a/src/dhcp/nm-dhcp-client.h b/src/dhcp/nm-dhcp-client.h
index d790e3e10a..e41a59a265 100644
--- a/src/dhcp/nm-dhcp-client.h
+++ b/src/dhcp/nm-dhcp-client.h
@@ -123,13 +123,13 @@ GBytes *nm_dhcp_client_get_client_id (NMDhcpClient *self);
const char *nm_dhcp_client_get_hostname (NMDhcpClient *self);
-const char *nm_dhcp_client_get_fqdn (NMDhcpClient *self);
+gboolean nm_dhcp_client_get_use_fqdn (NMDhcpClient *self);
gboolean nm_dhcp_client_start_ip4 (NMDhcpClient *self,
const char *dhcp_client_id,
const char *dhcp_anycast_addr,
const char *hostname,
- const char *fqdn,
+ gboolean use_fqdn,
const char *last_ip4_address);
gboolean nm_dhcp_client_start_ip6 (NMDhcpClient *self,
diff --git a/src/dhcp/nm-dhcp-dhclient-utils.c b/src/dhcp/nm-dhcp-dhclient-utils.c
index d63aba4dd2..7095a8df9c 100644
--- a/src/dhcp/nm-dhcp-dhclient-utils.c
+++ b/src/dhcp/nm-dhcp-dhclient-utils.c
@@ -93,29 +93,31 @@ grab_request_options (GPtrArray *store, const char* line)
static void
-add_hostname4 (GString *str, const char *hostname, const char *fqdn)
+add_hostname4 (GString *str, const char *hostname, gboolean use_fqdn)
{
char *plain_hostname, *dot;
- if (fqdn) {
- g_string_append_printf (str, FQDN_FORMAT "\n", fqdn);
- g_string_append (str,
- "send fqdn.encoded on;\n"
- "send fqdn.server-update on;\n");
- } else if (hostname) {
- plain_hostname = g_strdup (hostname);
- dot = strchr (plain_hostname, '.');
- /* get rid of the domain */
- if (dot)
- *dot = '\0';
-
- g_string_append_printf (str, HOSTNAME4_FORMAT "\n", plain_hostname);
- g_free (plain_hostname);
+ if (hostname) {
+ if (use_fqdn) {
+ g_string_append_printf (str, FQDN_FORMAT "\n", hostname);
+ g_string_append (str,
+ "send fqdn.encoded on;\n"
+ "send fqdn.server-update on;\n");
+ } else {
+ plain_hostname = g_strdup (hostname);
+ dot = strchr (plain_hostname, '.');
+ /* get rid of the domain */
+ if (dot)
+ *dot = '\0';
+
+ g_string_append_printf (str, HOSTNAME4_FORMAT "\n", plain_hostname);
+ g_free (plain_hostname);
+ }
}
}
static void
-add_ip4_config (GString *str, GBytes *client_id, const char *hostname, const char *fqdn)
+add_ip4_config (GString *str, GBytes *client_id, const char *hostname, gboolean use_fqdn)
{
if (client_id) {
const char *p;
@@ -150,7 +152,7 @@ add_ip4_config (GString *str, GBytes *client_id, const char *hostname, const cha
g_string_append (str, "; # added by NetworkManager\n");
}
- add_hostname4 (str, hostname, fqdn);
+ add_hostname4 (str, hostname, use_fqdn);
g_string_append_c (str, '\n');
@@ -271,7 +273,7 @@ nm_dhcp_dhclient_create_config (const char *interface,
GBytes *client_id,
const char *anycast_addr,
const char *hostname,
- const char *fqdn,
+ gboolean use_fqdn,
const char *orig_path,
const char *orig_contents,
GBytes **out_new_client_id)
@@ -328,7 +330,7 @@ nm_dhcp_dhclient_create_config (const char *interface,
}
/* Override config file hostname and use one from the connection */
- if (hostname || fqdn) {
+ if (hostname) {
if (strncmp (p, HOSTNAME4_TAG, strlen (HOSTNAME4_TAG)) == 0)
continue;
if (strncmp (p, FQDN_TAG, strlen (FQDN_TAG)) == 0)
@@ -388,7 +390,7 @@ nm_dhcp_dhclient_create_config (const char *interface,
add_request (reqs, "dhcp6.domain-search");
add_request (reqs, "dhcp6.client-id");
} else {
- add_ip4_config (new_contents, client_id, hostname, fqdn);
+ add_ip4_config (new_contents, client_id, hostname, use_fqdn);
add_request (reqs, "rfc3442-classless-static-routes");
add_request (reqs, "ms-classless-static-routes");
add_request (reqs, "static-routes");
diff --git a/src/dhcp/nm-dhcp-dhclient-utils.h b/src/dhcp/nm-dhcp-dhclient-utils.h
index d1ab1ba968..994b1b9f02 100644
--- a/src/dhcp/nm-dhcp-dhclient-utils.h
+++ b/src/dhcp/nm-dhcp-dhclient-utils.h
@@ -27,7 +27,7 @@ char *nm_dhcp_dhclient_create_config (const char *interface,
GBytes *client_id,
const char *anycast_addr,
const char *hostname,
- const char *fqdn,
+ gboolean use_fqdn,
const char *orig_path,
const char *orig_contents,
GBytes **out_new_client_id);
diff --git a/src/dhcp/nm-dhcp-dhclient.c b/src/dhcp/nm-dhcp-dhclient.c
index dc66be25dd..a56e5a3ceb 100644
--- a/src/dhcp/nm-dhcp-dhclient.c
+++ b/src/dhcp/nm-dhcp-dhclient.c
@@ -182,7 +182,7 @@ merge_dhclient_config (NMDhcpDhclient *self,
GBytes *client_id,
const char *anycast_addr,
const char *hostname,
- const char *fqdn,
+ gboolean use_fqdn,
const char *orig_path,
GBytes **out_new_client_id,
GError **error)
@@ -206,7 +206,7 @@ merge_dhclient_config (NMDhcpDhclient *self,
if (is_ip6 && hostname && !strchr (hostname, '.'))
_LOGW ("hostname is not a FQDN, it will be ignored");
- new = nm_dhcp_dhclient_create_config (iface, is_ip6, client_id, anycast_addr, hostname, fqdn, orig_path, orig, out_new_client_id);
+ new = nm_dhcp_dhclient_create_config (iface, is_ip6, client_id, anycast_addr, hostname, use_fqdn, orig_path, orig, out_new_client_id);
g_assert (new);
success = g_file_set_contents (conf_file, new, -1, error);
g_free (new);
@@ -294,7 +294,7 @@ create_dhclient_config (NMDhcpDhclient *self,
GBytes *client_id,
const char *dhcp_anycast_addr,
const char *hostname,
- const char *fqdn,
+ gboolean use_fqdn,
GBytes **out_new_client_id)
{
char *orig = NULL, *new = NULL;
@@ -314,7 +314,7 @@ create_dhclient_config (NMDhcpDhclient *self,
error = NULL;
success = merge_dhclient_config (self, iface, new, is_ip6, client_id, dhcp_anycast_addr,
- hostname, fqdn, orig, out_new_client_id, &error);
+ hostname, use_fqdn, orig, out_new_client_id, &error);
if (!success) {
_LOGW ("error creating dhclient configuration: %s", error->message);
g_error_free (error);
@@ -505,17 +505,18 @@ ip4_start (NMDhcpClient *client, const char *dhcp_anycast_addr, const char *last
NMDhcpDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (self);
GBytes *client_id;
gs_unref_bytes GBytes *new_client_id = NULL;
- const char *iface, *uuid, *hostname, *fqdn;
+ const char *iface, *uuid, *hostname;
gboolean success = FALSE;
+ gboolean use_fqdn;
iface = nm_dhcp_client_get_iface (client);
uuid = nm_dhcp_client_get_uuid (client);
client_id = nm_dhcp_client_get_client_id (client);
hostname = nm_dhcp_client_get_hostname (client);
- fqdn = nm_dhcp_client_get_fqdn (client);
+ use_fqdn = nm_dhcp_client_get_use_fqdn (client);
priv->conf_file = create_dhclient_config (self, iface, FALSE, uuid, client_id, dhcp_anycast_addr,
- hostname, fqdn, &new_client_id);
+ hostname, use_fqdn, &new_client_id);
if (priv->conf_file) {
if (new_client_id)
nm_dhcp_client_set_client_id (client, new_client_id);
@@ -543,7 +544,7 @@ ip6_start (NMDhcpClient *client,
uuid = nm_dhcp_client_get_uuid (client);
hostname = nm_dhcp_client_get_hostname (client);
- priv->conf_file = create_dhclient_config (self, iface, TRUE, uuid, NULL, dhcp_anycast_addr, hostname, NULL, NULL);
+ priv->conf_file = create_dhclient_config (self, iface, TRUE, uuid, NULL, dhcp_anycast_addr, hostname, TRUE, NULL);
if (!priv->conf_file) {
_LOGW ("error creating dhclient configuration file");
return FALSE;
diff --git a/src/dhcp/nm-dhcp-dhcpcd.c b/src/dhcp/nm-dhcp-dhcpcd.c
index c8643881fc..54af2d4302 100644
--- a/src/dhcp/nm-dhcp-dhcpcd.c
+++ b/src/dhcp/nm-dhcp-dhcpcd.c
@@ -89,7 +89,7 @@ ip4_start (NMDhcpClient *client, const char *dhcp_anycast_addr, const char *last
pid_t pid = -1;
GError *error = NULL;
char *pid_contents = NULL, *binary_name, *cmd_str, *dot;
- const char *iface, *dhcpcd_path, *hostname, *fqdn;
+ const char *iface, *dhcpcd_path, *hostname;
gs_free char *prefix = NULL;
g_return_val_if_fail (priv->pid_file == NULL, FALSE);
@@ -138,22 +138,23 @@ ip4_start (NMDhcpClient *client, const char *dhcp_anycast_addr, const char *last
#endif
hostname = nm_dhcp_client_get_hostname (client);
- fqdn = nm_dhcp_client_get_fqdn (client);
-
- if (fqdn) {
- g_ptr_array_add (argv, (gpointer) "-h");
- g_ptr_array_add (argv, (gpointer) fqdn);
- g_ptr_array_add (argv, (gpointer) "-F");
- g_ptr_array_add (argv, (gpointer) "both");
- } else if (hostname) {
- prefix = strdup (hostname);
- dot = strchr (prefix, '.');
- /* get rid of the domain */
- if (dot)
- *dot = '\0';
-
- g_ptr_array_add (argv, (gpointer) "-h"); /* Send hostname to DHCP server */
- g_ptr_array_add (argv, (gpointer) prefix);
+
+ if (hostname) {
+ if (nm_dhcp_client_get_use_fqdn (client)) {
+ g_ptr_array_add (argv, (gpointer) "-h");
+ g_ptr_array_add (argv, (gpointer) hostname);
+ g_ptr_array_add (argv, (gpointer) "-F");
+ g_ptr_array_add (argv, (gpointer) "both");
+ } else {
+ prefix = strdup (hostname);
+ dot = strchr (prefix, '.');
+ /* get rid of the domain */
+ if (dot)
+ *dot = '\0';
+
+ g_ptr_array_add (argv, (gpointer) "-h"); /* Send hostname to DHCP server */
+ g_ptr_array_add (argv, (gpointer) prefix);
+ }
}
g_ptr_array_add (argv, (gpointer) iface);
diff --git a/src/dhcp/nm-dhcp-manager.c b/src/dhcp/nm-dhcp-manager.c
index 9c1fbb38bf..c3018ef5c5 100644
--- a/src/dhcp/nm-dhcp-manager.c
+++ b/src/dhcp/nm-dhcp-manager.c
@@ -163,7 +163,7 @@ client_start (NMDhcpManager *self,
guint32 timeout,
const char *dhcp_anycast_addr,
const char *hostname,
- const char *fqdn,
+ gboolean hostname_use_fqdn,
gboolean info_only,
NMSettingIP6ConfigPrivacy privacy,
const char *last_ip4_address,
@@ -209,7 +209,7 @@ client_start (NMDhcpManager *self,
if (ipv6)
success = nm_dhcp_client_start_ip6 (client, dhcp_anycast_addr, ipv6_ll_addr, hostname, info_only, privacy, needed_prefixes);
else
- success = nm_dhcp_client_start_ip4 (client, dhcp_client_id, dhcp_anycast_addr, hostname, fqdn, last_ip4_address);
+ success = nm_dhcp_client_start_ip4 (client, dhcp_client_id, dhcp_anycast_addr, hostname, hostname_use_fqdn, last_ip4_address);
if (!success) {
remove_client (self, client);
@@ -245,17 +245,21 @@ nm_dhcp_manager_start_ip4 (NMDhcpManager *self,
const char *last_ip_address)
{
const char *hostname = NULL;
- const char *fqdn = NULL;
+ gboolean use_fqdn = FALSE;
g_return_val_if_fail (NM_IS_DHCP_MANAGER (self), NULL);
if (send_hostname) {
- hostname = get_send_hostname (self, dhcp_hostname);
- fqdn = dhcp_fqdn;
+ if (dhcp_fqdn) {
+ hostname = dhcp_fqdn;
+ use_fqdn = TRUE;
+ } else
+ hostname = get_send_hostname (self, dhcp_hostname);
}
+
return client_start (self, iface, ifindex, hwaddr, uuid, priority, FALSE, NULL,
dhcp_client_id, timeout, dhcp_anycast_addr, hostname,
- fqdn, FALSE, 0, last_ip_address, 0);
+ use_fqdn, FALSE, 0, last_ip_address, 0);
}
/* Caller owns a reference to the NMDhcpClient on return */
@@ -282,7 +286,7 @@ nm_dhcp_manager_start_ip6 (NMDhcpManager *self,
if (send_hostname)
hostname = get_send_hostname (self, dhcp_hostname);
return client_start (self, iface, ifindex, hwaddr, uuid, priority, TRUE,
- ll_addr, NULL, timeout, dhcp_anycast_addr, hostname, NULL, info_only,
+ ll_addr, NULL, timeout, dhcp_anycast_addr, hostname, TRUE, info_only,
privacy, NULL, needed_prefixes);
}
diff --git a/src/dhcp/nm-dhcp-systemd.c b/src/dhcp/nm-dhcp-systemd.c
index 7067275bc3..96be65ae1c 100644
--- a/src/dhcp/nm-dhcp-systemd.c
+++ b/src/dhcp/nm-dhcp-systemd.c
@@ -580,7 +580,7 @@ ip4_start (NMDhcpClient *client, const char *dhcp_anycast_addr, const char *last
const uint8_t *client_id = NULL;
size_t client_id_len = 0;
struct in_addr last_addr = { 0 };
- const char *hostname, *fqdn;
+ const char *hostname;
int r, i;
gboolean success = FALSE;
guint16 arp_type;
@@ -687,29 +687,28 @@ ip4_start (NMDhcpClient *client, const char *dhcp_anycast_addr, const char *last
hostname = nm_dhcp_client_get_hostname (client);
if (hostname) {
- char *prefix, *dot;
+ if (nm_dhcp_client_get_use_fqdn (client)) {
+ r = sd_dhcp_client_set_hostname (priv->client4, hostname);
+ if (r < 0) {
+ _LOGW ("failed to set DHCP FQDN (%d)", r);
+ goto error;
+ }
+ } else {
+ char *prefix, *dot;
- prefix = strdup (hostname);
- dot = strchr (prefix, '.');
- /* get rid of the domain */
- if (dot)
- *dot = '\0';
+ prefix = strdup (hostname);
+ dot = strchr (prefix, '.');
+ /* get rid of the domain */
+ if (dot)
+ *dot = '\0';
- r = sd_dhcp_client_set_hostname (priv->client4, prefix);
- free (prefix);
+ r = sd_dhcp_client_set_hostname (priv->client4, prefix);
+ free (prefix);
- if (r < 0) {
- _LOGW ("failed to set DHCP hostname (%d)", r);
- goto error;
- }
- }
-
- fqdn = nm_dhcp_client_get_fqdn (client);
- if (fqdn) {
- r = sd_dhcp_client_set_hostname (priv->client4, fqdn);
- if (r < 0) {
- _LOGW ("failed to set DHCP FQDN (%d)", r);
- goto error;
+ if (r < 0) {
+ _LOGW ("failed to set DHCP hostname (%d)", r);
+ goto error;
+ }
}
}
diff --git a/src/dhcp/tests/test-dhcp-dhclient.c b/src/dhcp/tests/test-dhcp-dhclient.c
index 361c7336be..40a3e072e7 100644
--- a/src/dhcp/tests/test-dhcp-dhclient.c
+++ b/src/dhcp/tests/test-dhcp-dhclient.c
@@ -40,7 +40,7 @@ test_config (const char *orig,
const char *expected,
gboolean ipv6,
const char *hostname,
- const char *fqdn,
+ gboolean use_fqdn,
const char *dhcp_client_id,
GBytes *expected_new_client_id,
const char *iface,
@@ -60,7 +60,7 @@ test_config (const char *orig,
client_id,
anycast_addr,
hostname,
- fqdn,
+ use_fqdn,
"/path/to/dhclient.conf",
orig,
&new_client_id);
@@ -105,7 +105,7 @@ static const char *orig_missing_expected = \
static void
test_orig_missing (void)
{
- test_config (NULL, orig_missing_expected, FALSE, NULL, NULL, NULL, NULL, "eth0", NULL);
+ test_config (NULL, orig_missing_expected, FALSE, NULL, FALSE, NULL, NULL, "eth0", NULL);
}
/*****************************************************************************/
@@ -134,7 +134,7 @@ static void
test_override_client_id (void)
{
test_config (override_client_id_orig, override_client_id_expected,
- FALSE, NULL, NULL,
+ FALSE, NULL, FALSE,
"11:22:33:44:55:66",
NULL,
"eth0",
@@ -163,7 +163,7 @@ static void
test_quote_client_id (void)
{
test_config (NULL, quote_client_id_expected,
- FALSE, NULL, NULL,
+ FALSE, NULL, FALSE,
"1234",
NULL,
"eth0",
@@ -192,7 +192,7 @@ static void
test_ascii_client_id (void)
{
test_config (NULL, ascii_client_id_expected,
- FALSE, NULL, NULL,
+ FALSE, NULL, FALSE,
"qb:cd:ef:12:34:56",
NULL,
"eth0",
@@ -221,7 +221,7 @@ static void
test_hex_single_client_id (void)
{
test_config (NULL, hex_single_client_id_expected,
- FALSE, NULL, NULL,
+ FALSE, NULL, FALSE,
"ab:cd:e:12:34:56",
NULL,
"eth0",
@@ -258,7 +258,7 @@ test_existing_hex_client_id (void)
new_client_id = g_bytes_new (bytes, sizeof (bytes));
test_config (existing_hex_client_id_orig, existing_hex_client_id_expected,
- FALSE, NULL, NULL,
+ FALSE, NULL, FALSE,
NULL,
new_client_id,
"eth0",
@@ -298,7 +298,7 @@ test_existing_ascii_client_id (void)
memcpy (buf + 1, EACID, NM_STRLEN (EACID));
new_client_id = g_bytes_new (buf, sizeof (buf));
test_config (existing_ascii_client_id_orig, existing_ascii_client_id_expected,
- FALSE, NULL, NULL,
+ FALSE, NULL, FALSE,
NULL,
new_client_id,
"eth0",
@@ -327,8 +327,8 @@ static void
test_fqdn (void)
{
test_config (NULL, fqdn_expected,
- FALSE, NULL,
- "foo.bar.com", NULL,
+ FALSE, "foo.bar.com",
+ TRUE, NULL,
NULL,
"eth0",
NULL);
@@ -367,8 +367,8 @@ test_fqdn_options_override (void)
{
test_config (fqdn_options_override_orig,
fqdn_options_override_expected,
- FALSE, NULL,
- "example2.com", NULL,
+ FALSE, "example2.com",
+ TRUE, NULL,
NULL,
"eth0",
NULL);
@@ -400,7 +400,7 @@ static void
test_override_hostname (void)
{
test_config (override_hostname_orig, override_hostname_expected,
- FALSE, "blahblah", NULL,
+ FALSE, "blahblah", FALSE,
NULL,
NULL,
"eth0",
@@ -429,7 +429,7 @@ static void
test_override_hostname6 (void)
{
test_config (override_hostname6_orig, override_hostname6_expected,
- TRUE, "blahblah.local", NULL,
+ TRUE, "blahblah.local", TRUE,
NULL,
NULL,
"eth0",
@@ -452,7 +452,7 @@ test_nonfqdn_hostname6 (void)
/* Non-FQDN hostname can't be used with dhclient */
test_config (NULL, nonfqdn_hostname6_expected,
TRUE, "blahblah",
- NULL, NULL,
+ TRUE, NULL,
NULL,
"eth0",
NULL);
@@ -487,7 +487,7 @@ test_existing_alsoreq (void)
{
test_config (existing_alsoreq_orig, existing_alsoreq_expected,
FALSE, NULL,
- NULL,
+ FALSE,
NULL,
NULL,
"eth0",
@@ -526,7 +526,7 @@ test_existing_req (void)
{
test_config (existing_req_orig, existing_req_expected,
FALSE, NULL,
- NULL,
+ FALSE,
NULL,
NULL,
"eth0",
@@ -565,7 +565,7 @@ static void
test_existing_multiline_alsoreq (void)
{
test_config (existing_multiline_alsoreq_orig, existing_multiline_alsoreq_expected,
- FALSE, NULL, NULL,
+ FALSE, NULL, FALSE,
NULL,
NULL,
"eth0",
@@ -779,7 +779,7 @@ static void
test_interface1 (void)
{
test_config (interface1_orig, interface1_expected,
- FALSE, NULL, NULL,
+ FALSE, NULL, FALSE,
NULL,
NULL,
"eth0",
@@ -824,7 +824,7 @@ static void
test_interface2 (void)
{
test_config (interface2_orig, interface2_expected,
- FALSE, NULL, NULL,
+ FALSE, NULL, FALSE,
NULL,
NULL,
"eth1",