summaryrefslogtreecommitdiff
path: root/lib/vsprintf.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-12-05 13:28:22 -0500
committerTom Rini <trini@konsulko.com>2022-12-05 13:28:22 -0500
commit6616ddb0f09c4ef3e8a79b76b146dbbd9c8f8c3d (patch)
tree9df20918981d508e1c9f8b27533abce955073889 /lib/vsprintf.c
parenta50622d78c5c6babd1853ae913f339df54fe532c (diff)
parenta72926257c1dbc456d1cd02fc6bd5ef6147e143f (diff)
Merge branch '2022-12-05-add-IPv6-support'
To quote the author: This patch set adds basic IPv6 support to U-boot. It is based on Chris's Packham patches (https://lists.denx.de/pipermail/u-boot/2017-January/279366.html) Chris's patches were taken as base. There were efforts to launch it on HiFive SiFive Unmatched board but the board didn't work well. The code was refactored, fixed some bugs as CRC for little-endian, some parts were implemented in our own way, something was taken from Linux. Finally we did manual tests and the board worked well. Testing was done on HiFive SiFive Unmatched board (RISC-V)
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r--lib/vsprintf.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index fe06aa2d711..530d8088c7f 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -450,10 +450,6 @@ static char *uuid_string(char *buf, char *end, u8 *addr, int field_width,
* decimal for v4 and colon separated network-order 16 bit hex for v6)
* - 'i' [46] for 'raw' IPv4/IPv6 addresses, IPv6 omits the colons, IPv4 is
* currently the same
- *
- * Note: IPv6 support is currently if(0)'ed out. If you ever need
- * %pI6, please add an IPV6 Kconfig knob, make your code select or
- * depend on that, and change the 0 below to CONFIG_IS_ENABLED(IPV6).
*/
static char *pointer(const char *fmt, char *buf, char *end, void *ptr,
int field_width, int precision, int flags)
@@ -498,8 +494,7 @@ static char *pointer(const char *fmt, char *buf, char *end, void *ptr,
flags |= SPECIAL;
/* Fallthrough */
case 'I':
- /* %pI6 currently unused */
- if (0 && fmt[1] == '6')
+ if (IS_ENABLED(CONFIG_IPV6) && fmt[1] == '6')
return ip6_addr_string(buf, end, ptr, field_width,
precision, flags);
if (fmt[1] == '4')