GNOME Bugzilla – Bug 762432
Enable DHCPv6 support in internal DHCP client
Last modified: 2016-03-03 10:38:34 UTC
The internal DHCP client doesn't support DHCPv6 at the moment, but probably we only need to add some code to handle the lease from libnetworkd. wip branch bg/dhcp6-internal.
+ memset (&address, 0, sizeof (address)); + address.plen = 128; + address.address = tmp_addr; NMPlatformIP6Address address = { .plen = 128, .address = tmp_addr, ... }; address.timestamp = nm_utils_get_monotonic_timestamp_s (); cache the timestamp. First, you don't want to repeatedly call clock_gettime(). Then, you don't want to possible have different times for the same set of addresses. + LOG_LEASE (LOGD_DHCP6, + " address %s expires in %" G_GUINT32_FORMAT " seconds", + addr_str, + address.lifetime); use nm_platform_ip6_address_to_string(). It prints all the information of the address, in a default format. Let's only create the @str instance once. No need to free and reallocate it. Just g_string_set_size(str, 0). + guint32 default_priority, is unused. + g_hash_table_destroy (options); + g_clear_object (&ip6_config); gs_unref_object, gs_unref_hashtable? nm_log_dbg (LOGD_DHCP6, "(%s): lease available", iface); could we add a _NMLOG() macro? nm_log_warn (LOGD_DHCP6, "(%s): %s", iface, error->message); results in a message like "(eth0): no address received in managed mode" It should give a bit more context information, like "(%s): ipv6-lease: invalid lease received (%s)"
Fixed and repushed. Note that the libsystemd-network DHCPv6 client at the moment doesn't support sending the hostname to the server, this needs to be added upstream.
pushed minor fixup. lgtm
Merged the patch as: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=89d1e466157839096b446068a780cb2563424a5a and moved logging changes to a separate branch.