mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-24 09:10:43 +02:00
core, clients: implement dhcp-send-hostname for IPv6
Now that NMSettingIP6Config inherits the dhcp-send-hostname property from NMSettingIPConfig, fix things up so that it actually gets used. (Note that this changes behavior: previously if ip6.dhcp-hostname was unset, no hostname would be sent. Now, the system hostname will be set. Also, ifcfg-rh does not currently support this property, so there is no way to disable this...)
This commit is contained in:
parent
3f30c6f1c2
commit
35f6264745
4 changed files with 19 additions and 5 deletions
|
|
@ -295,7 +295,8 @@ NmcOutputField nmc_fields_setting_ip6_config[] = {
|
|||
SETTING_FIELD (NM_SETTING_IP_CONFIG_NEVER_DEFAULT, 15), /* 8 */
|
||||
SETTING_FIELD (NM_SETTING_IP_CONFIG_MAY_FAIL, 12), /* 9 */
|
||||
SETTING_FIELD (NM_SETTING_IP6_CONFIG_IP6_PRIVACY, 15), /* 10 */
|
||||
SETTING_FIELD (NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, 14), /* 11 */
|
||||
SETTING_FIELD (NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME, 19), /* 11 */
|
||||
SETTING_FIELD (NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, 14), /* 12 */
|
||||
{NULL, NULL, 0, NULL, FALSE, FALSE, 0}
|
||||
};
|
||||
#define NMC_FIELDS_SETTING_IP6_CONFIG_ALL "name"","\
|
||||
|
|
@ -309,6 +310,7 @@ NmcOutputField nmc_fields_setting_ip6_config[] = {
|
|||
NM_SETTING_IP_CONFIG_NEVER_DEFAULT","\
|
||||
NM_SETTING_IP_CONFIG_MAY_FAIL","\
|
||||
NM_SETTING_IP6_CONFIG_IP6_PRIVACY","\
|
||||
NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME","\
|
||||
NM_SETTING_IP_CONFIG_DHCP_HOSTNAME
|
||||
#define NMC_FIELDS_SETTING_IP6_CONFIG_COMMON NMC_FIELDS_SETTING_IP4_CONFIG_ALL
|
||||
|
||||
|
|
@ -1363,6 +1365,7 @@ DEFINE_GETTER (nmc_property_ipv6_get_ignore_auto_routes, NM_SETTING_IP_CONFIG_IG
|
|||
DEFINE_GETTER (nmc_property_ipv6_get_ignore_auto_dns, NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS)
|
||||
DEFINE_GETTER (nmc_property_ipv6_get_never_default, NM_SETTING_IP_CONFIG_NEVER_DEFAULT)
|
||||
DEFINE_GETTER (nmc_property_ipv6_get_may_fail, NM_SETTING_IP_CONFIG_MAY_FAIL)
|
||||
DEFINE_GETTER (nmc_property_ipv6_get_dhcp_send_hostname, NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME)
|
||||
DEFINE_GETTER (nmc_property_ipv6_get_dhcp_hostname, NM_SETTING_IP_CONFIG_DHCP_HOSTNAME)
|
||||
|
||||
static char *
|
||||
|
|
@ -5579,6 +5582,13 @@ nmc_properties_init (void)
|
|||
NULL,
|
||||
NULL,
|
||||
nmc_property_out2in_cut_paren);
|
||||
nmc_add_prop_funcs (GLUE_IP (6, DHCP_SEND_HOSTNAME),
|
||||
nmc_property_ipv6_get_dhcp_send_hostname,
|
||||
nmc_property_set_bool,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
nmc_add_prop_funcs (GLUE_IP (6, DHCP_HOSTNAME),
|
||||
nmc_property_ipv6_get_dhcp_hostname,
|
||||
nmc_property_set_string,
|
||||
|
|
@ -6780,7 +6790,8 @@ setting_ip6_config_details (NMSetting *setting, NmCli *nmc, const char *one_pro
|
|||
set_val_str (arr, 8, nmc_property_ipv6_get_never_default (setting));
|
||||
set_val_str (arr, 9, nmc_property_ipv6_get_may_fail (setting));
|
||||
set_val_str (arr, 10, nmc_property_ipv6_get_ip6_privacy (setting));
|
||||
set_val_str (arr, 11, nmc_property_ipv6_get_dhcp_hostname (setting));
|
||||
set_val_str (arr, 11, nmc_property_ipv6_get_dhcp_send_hostname (setting));
|
||||
set_val_str (arr, 12, nmc_property_ipv6_get_dhcp_hostname (setting));
|
||||
g_ptr_array_add (nmc->output_data, arr);
|
||||
|
||||
print_data (nmc); /* Print all data */
|
||||
|
|
|
|||
|
|
@ -3356,6 +3356,7 @@ dhcp6_start (NMDevice *self,
|
|||
tmp,
|
||||
nm_connection_get_uuid (connection),
|
||||
nm_device_get_priority (self),
|
||||
nm_setting_ip_config_get_dhcp_send_hostname (s_ip6),
|
||||
nm_setting_ip_config_get_dhcp_hostname (s_ip6),
|
||||
priv->dhcp_timeout,
|
||||
priv->dhcp_anycast_address,
|
||||
|
|
|
|||
|
|
@ -459,18 +459,19 @@ nm_dhcp_manager_start_ip6 (NMDhcpManager *self,
|
|||
const GByteArray *hwaddr,
|
||||
const char *uuid,
|
||||
guint priority,
|
||||
gboolean send_hostname,
|
||||
const char *dhcp_hostname,
|
||||
guint32 timeout,
|
||||
const char *dhcp_anycast_addr,
|
||||
gboolean info_only,
|
||||
NMSettingIP6ConfigPrivacy privacy)
|
||||
{
|
||||
const char *hostname;
|
||||
const char *hostname = NULL;
|
||||
|
||||
g_return_val_if_fail (NM_IS_DHCP_MANAGER (self), NULL);
|
||||
|
||||
hostname = dhcp_hostname ? get_send_hostname (self, dhcp_hostname) : NULL;
|
||||
|
||||
if (send_hostname)
|
||||
hostname = get_send_hostname (self, dhcp_hostname);
|
||||
return client_start (self, iface, ifindex, hwaddr, uuid, priority, TRUE,
|
||||
NULL, timeout, dhcp_anycast_addr, hostname, info_only,
|
||||
privacy);
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ NMDhcpClient * nm_dhcp_manager_start_ip6 (NMDhcpManager *manager,
|
|||
const GByteArray *hwaddr,
|
||||
const char *uuid,
|
||||
guint priority,
|
||||
gboolean send_hostname,
|
||||
const char *dhcp_hostname,
|
||||
guint32 timeout,
|
||||
const char *dhcp_anycast_addr,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue