dhcpv4: display two hex digits per octet in syslog
authorLeon M. George <leon@georgemail.eu>
Fri, 12 May 2017 12:12:34 +0000 (14:12 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Fri, 12 May 2017 13:51:16 +0000 (15:51 +0200)
Signed-off-by: Leon M. George <leon@georgemail.eu>
src/dhcpv4.c

index 81e537d3ddbb8f4b7bc6e770e213c228ced1819f..21d94f2290330ed291db37f79f76c2792a1f5f14 100644 (file)
@@ -378,7 +378,7 @@ static void handle_dhcpv4(void *addr, void *data, size_t len,
                 */
        }
 
-       syslog(LOG_WARNING, "received %s from %x:%x:%x:%x:%x:%x",
+       syslog(LOG_WARNING, "received %s from %02x:%02x:%02x:%02x:%02x:%02x",
                        dhcpv4_msg_to_string(reqmsg),
                        req->chaddr[0],req->chaddr[1],req->chaddr[2],
                        req->chaddr[3],req->chaddr[4],req->chaddr[5]);
@@ -502,7 +502,7 @@ static void handle_dhcpv4(void *addr, void *data, size_t len,
                 * reply is send directly to IP,
                 * MAC is assumed to be the same as the request
                 */
-               syslog(LOG_WARNING, "sending %s to %x:%x:%x:%x:%x:%x - %s",
+               syslog(LOG_WARNING, "sending %s to %02x:%02x:%02x:%02x:%02x:%02x - %s",
                                dhcpv4_msg_to_string(msg),
                                req->chaddr[0],req->chaddr[1],req->chaddr[2],
                                req->chaddr[3],req->chaddr[4],req->chaddr[5],