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: <trace> [1464520695.7655] dhcp4 (enp0s25): dhcp-client4: set 0x556cdd9d6800 <debug> [1464520695.7658] libsystemd: DHCP CLIENT (0x9d87b7c5): STARTED on ifindex 2
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user