From: Matthew Iselin <matt...@theiselins.net>

Signed-off-by: Matthew Iselin <matt...@theiselins.net>
---
 src/net/ipv6.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/net/ipv6.c b/src/net/ipv6.c
index 8d884db..5ce4e1a 100644
--- a/src/net/ipv6.c
+++ b/src/net/ipv6.c
@@ -379,6 +379,13 @@ char * inet6_ntoa ( struct in6_addr in6 ) {
        uint16_t *bytes = ( uint16_t* ) &in6;
        size_t i = 0, longest = 0, tmp = 0, long_idx = ~0;
 
+       /* ::0 */
+       if ( IP6_EQUAL ( in6, ip6_none ) ) {
+               tmp = sprintf ( buf, "::0" );
+               buf[tmp] = 0;
+               return buf;
+       }
+
        /* Determine the longest string of zeroes for zero-compression. */
        for ( ; i < 8; i++ ) {
                if ( !bytes[i] )
-- 
1.7.2.5

_______________________________________________
gPXE-devel mailing list
gPXE-devel@etherboot.org
http://etherboot.org/mailman/listinfo/gpxe-devel

Reply via email to