After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 762432 - Enable DHCPv6 support in internal DHCP client
Enable DHCPv6 support in internal DHCP client
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: IP and DNS config
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks: nm-1-2
 
 
Reported: 2016-02-22 10:10 UTC by Beniamino Galvani
Modified: 2016-03-03 10:38 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Beniamino Galvani 2016-02-22 10:10:18 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.
Comment 1 Thomas Haller 2016-02-22 11:09:59 UTC
+         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)"
Comment 2 Beniamino Galvani 2016-02-23 10:25:21 UTC
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.
Comment 3 Thomas Haller 2016-02-23 12:27:39 UTC
pushed minor fixup.

lgtm
Comment 4 Beniamino Galvani 2016-03-03 10:38:34 UTC
Merged the patch as:

https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=89d1e466157839096b446068a780cb2563424a5a

and moved logging changes to a separate branch.