From 04852d2877cf94d80d17d0e3f46eb1d286a0ecdb Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sun, 29 May 2016 13:14:48 +0200 Subject: dhcp: log setting and clearing systemd dhcp client instance internal systemd code produces logging messages by itself, like libsystemd: DHCP CLIENT (0x9204b5ce): ACK Let's log the pointer value initially, to associate the logged "xid" with the pointer value of the client. Now we get: [1464520695.7655] dhcp4 (enp0s25): dhcp-client4: set 0x556cdd9d6800 [1464520695.7658] libsystemd: DHCP CLIENT (0x9d87b7c5): STARTED on ifindex 2 --- src/dhcp-manager/nm-dhcp-systemd.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/dhcp-manager/nm-dhcp-systemd.c b/src/dhcp-manager/nm-dhcp-systemd.c index 10f03ec962..ae9936e05d 100644 --- a/src/dhcp-manager/nm-dhcp-systemd.c +++ b/src/dhcp-manager/nm-dhcp-systemd.c @@ -578,6 +578,8 @@ ip4_start (NMDhcpClient *client, const char *dhcp_anycast_addr, const char *last return FALSE; } + _LOGT ("dhcp-client4: set %p", priv->client4); + r = sd_dhcp_client_attach_event (priv->client4, NULL, 0); if (r < 0) { _LOGW ("failed to attach event (%d)", r); @@ -895,6 +897,8 @@ ip6_start (NMDhcpClient *client, return FALSE; } + _LOGT ("dhcp-client6: set %p", priv->client4); + if (info_only) sd_dhcp6_client_set_information_request (priv->client6, 1); @@ -973,6 +977,10 @@ stop (NMDhcpClient *client, gboolean release, const GByteArray *duid) NMDhcpSystemdPrivate *priv = NM_DHCP_SYSTEMD_GET_PRIVATE (self); int r = 0; + _LOGT ("dhcp-client%d: stop %p", + priv->client4 ? '4' : '6', + priv->client4 ? (gpointer) priv->client4 : (gpointer) priv->client6); + if (priv->client4) { sd_dhcp_client_set_callback (priv->client4, NULL, NULL); r = sd_dhcp_client_stop (priv->client4); -- cgit v1.2.1