From 9f455bcb34fcab31b0eb8eec5702105c8d4bde18 Mon Sep 17 00:00:00 2001 From: "oliver@schinagl.nl" Date: Fri, 25 Nov 2016 16:30:20 +0100 Subject: net: cosmetic: Make the MAC address string less magical In u-boot printf has been extended with the %pM formatter to allow printing of MAC addresses. However buffers that want to store a MAC address cannot safely get the size. Add a define for this case so the string of a MAC address can be reliably obtained. Signed-off-by: Olliver Schinagl Acked-by: Joe Hershberger --- include/net.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/net.h b/include/net.h index 61568f6b319..c3bfb637820 100644 --- a/include/net.h +++ b/include/net.h @@ -40,6 +40,11 @@ /* ARP hardware address length */ #define ARP_HLEN 6 +/* + * The size of a MAC address in string form, each digit requires two chars + * and five separator characters to form '00:00:00:00:00:00'. + */ +#define ARP_HLEN_ASCII (ARP_HLEN * 2) + (ARP_HLEN - 1) /* IPv4 addresses are always 32 bits in size */ struct in_addr { -- cgit v1.2.3