[LEDE-DEV] [PATCH] display two hex digits per octet in syslog

leon at georgemail.eu leon at georgemail.eu
Fri May 12 05:12:34 PDT 2017


From: "Leon M. George" <leon at georgemail.eu>

Signed-off-by: Leon M. George <leon at georgemail.eu>
---
 src/dhcpv4.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/dhcpv4.c b/src/dhcpv4.c
index 81e537d..21d94f2 100644
--- a/src/dhcpv4.c
+++ b/src/dhcpv4.c
@@ -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],
-- 
2.12.2




More information about the Lede-dev mailing list