From 42080aceac5031e895c645d075035d417906c932 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 3 Jul 2018 16:14:22 -0400 Subject: [PATCH] DHCPClient: Tweaks to logging. * "timeout" is in usecs, so / 1000 and say "msecs" not "secs" * Debug-log messages that are not for us received while waiting for a message that is for us. Hopefully this will not flood the syslog (DHCP renegotiation is, after all, rare), and it might help diagnose some of the DHCP failures. --- src/servers/net/DHCPClient.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/servers/net/DHCPClient.cpp b/src/servers/net/DHCPClient.cpp index 7ae8755cf3..8781fef802 100644 --- a/src/servers/net/DHCPClient.cpp +++ b/src/servers/net/DHCPClient.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2006-2011, Haiku, Inc. All Rights Reserved. + * Copyright 2006-2018, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -460,8 +460,8 @@ socket_timeout::Shift(int socket, bigtime_t stateMaxTime, const char* device) timeout = std::max(remaining, bigtime_t(60)); } - syslog(LOG_DEBUG, "%s: Timeout shift: %lu secs (try %lu)\n", - device, timeout, tries); + syslog(LOG_DEBUG, "%s: Timeout shift: %lu msecs (try %lu)\n", + device, timeout / 1000, tries); UpdateSocket(socket); return true; @@ -746,6 +746,9 @@ DHCPClient::_StateTransition(int socket, dhcp_state& state) || memcmp(message->mac_address, discover.mac_address, discover.hardware_address_length)) { // this message is not for us + syslog(LOG_DEBUG, "%s: Ignoring %s not for us from %s\n", + Device(), dhcp_message::TypeToString(message->Type()), + _AddressToString(from.sin_addr.s_addr).String()); continue; }