From e40f7f744e128182ded44d66a8faf4e480d35e63 Mon Sep 17 00:00:00 2001 From: Andrey Gusakov Date: Mon, 11 Aug 2014 22:13:03 +0400 Subject: [PATCH] shared: format MAC with leading zeros Don't skip leading zeroes for MAC addresses. Some software cannot handle this well. Signed-off-by: Andrey Gusakov Signed-off-by: David Herrmann --- src/shared/util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/util.h b/src/shared/util.h index b411638..9df1de6 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -107,7 +107,7 @@ static inline void reformat_mac(char *dst, const char *src) sscanf(src, "%2hhx:%2hhx:%2hhx:%2hhx:%2hhx:%2hhx", &x1, &x2, &x3, &x4, &x5, &x6); - sprintf(dst, "%2hhx:%2hhx:%2hhx:%2hhx:%2hhx:%2hhx", + sprintf(dst, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx", x1, x2, x3, x4, x5, x6); }