diff options
author | Francesco Giudici <fgiudici@redhat.com> | 2018-04-06 18:25:06 +0200 |
---|---|---|
committer | Francesco Giudici <fgiudici@redhat.com> | 2018-06-07 14:38:02 +0200 |
commit | 72bfd55efc0120fa37a73d8af20040b52bcc89a8 (patch) | |
tree | 3bcdcd69292ca6e45fb3ba8e13f979efc1e45457 | |
parent | 1d048e556b600807894c80e78273f033d520aa25 (diff) | |
download | NetworkManager-72bfd55efc0120fa37a73d8af20040b52bcc89a8.tar.gz |
ifcfg: introduce DHCPV6_DUID to map ipv6.dhcp-duid property
-rw-r--r-- | libnm-core/nm-setting-ip6-config.c | 10 | ||||
-rw-r--r-- | src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c | 5 | ||||
-rw-r--r-- | src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c | 4 |
3 files changed, 19 insertions, 0 deletions
diff --git a/libnm-core/nm-setting-ip6-config.c b/libnm-core/nm-setting-ip6-config.c index d4f07ddddb..28d0c8b450 100644 --- a/libnm-core/nm-setting-ip6-config.c +++ b/libnm-core/nm-setting-ip6-config.c @@ -863,6 +863,16 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *ip6_class) * * Since: 1.12 **/ + /* ---ifcfg-rh--- + * property: dhcp-duid + * variable: DHCPV6_DUID(+) + * description: A string sent to the DHCPv6 server to identify the local machine. + * Apart from the special values "lease", "stable-llt", "stable-ll", "stable-uuid", + * "llt" and "ll" a binary value in hex format is expected. An hex string where + * each octet is separated by a colon is also accepted. + * example: DHCPV6_DUID=LL; DHCPV6_DUID=0301deadbeef0001; DHCPV6_DUID=03:01:de:ad:be:ef:00:01 + * ---end--- + */ g_object_class_install_property (object_class, PROP_DHCP_DUID, g_param_spec_string (NM_SETTING_IP6_CONFIG_DHCP_DUID, "", "", diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c index 4d9e7f6595..b16cc28122 100644 --- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c +++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c @@ -1824,6 +1824,11 @@ make_ip6_setting (shvarFile *ifcfg, return NM_SETTING (s_ip6); nm_clear_g_free (&value); + v = svGetValueStr (ifcfg, "DHCPV6_DUID", &value); + if (v) + g_object_set (s_ip6, NM_SETTING_IP6_CONFIG_DHCP_DUID, v, NULL); + + nm_clear_g_free (&value); v = svGetValueStr (ifcfg, "DHCPV6_HOSTNAME", &value); /* Use DHCP_HOSTNAME as fallback if it is in FQDN format and ipv6.method is * auto or dhcp: this is required to support old ifcfg files diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c index bdad738966..1656530911 100644 --- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c +++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c @@ -2568,6 +2568,7 @@ write_ip6_setting (NMConnection *connection, svUnsetValue (ifcfg, "IPV6INIT"); svUnsetValue (ifcfg, "IPV6_AUTOCONF"); svUnsetValue (ifcfg, "DHCPV6C"); + svUnsetValue (ifcfg, "DHCPv6_DUID"); svUnsetValue (ifcfg, "DHCPV6_HOSTNAME"); svUnsetValue (ifcfg, "DHCPV6_SEND_HOSTNAME"); svUnsetValue (ifcfg, "IPV6_DEFROUTE"); @@ -2608,6 +2609,9 @@ write_ip6_setting (NMConnection *connection, svUnsetValue (ifcfg, "DHCPV6C"); } + svSetValueStr (ifcfg, "DHCPV6_DUID", + nm_setting_ip6_config_get_dhcp_duid (NM_SETTING_IP6_CONFIG (s_ip6))); + write_ip6_setting_dhcp_hostname (s_ip6, ifcfg); /* Write out IP addresses */ |