]> Git Repo - J-u-boot.git/commitdiff
net: ipv6: Enable IPv6 typeconversion specifier
authorViacheslav Mitrofanov <[email protected]>
Fri, 2 Dec 2022 09:18:03 +0000 (12:18 +0300)
committerTom Rini <[email protected]>
Mon, 5 Dec 2022 17:47:16 +0000 (12:47 -0500)
Add the possibility to recognize IPv6 address in print function.
To output IPv6 address use %pI6 specifier.

Series-changes: 3
- Substituted #if (...) for if (...) to get better readability

Signed-off-by: Viacheslav Mitrofanov <[email protected]>
Reviewed-by: Ramon Fried <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
lib/vsprintf.c

index fe06aa2d71178546f46d822faf3b481925a8529c..530d8088c7f87fbb0fcf6b100380741587e4a7ad 100644 (file)
@@ -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')
This page took 0.037269 seconds and 4 git commands to generate.