NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/39519: inet_ntop returns NULL for IPv4 mapped address



>Number:         39519
>Category:       lib
>Synopsis:       inet_ntop returns NULL for IPv4 mapped address
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 11 13:00:00 +0000 2008
>Originator:     Nozomu Ando
>Release:        NetBSD 4.99.72
>Organization:
>Environment:
NetBSD mika 4.99.72 NetBSD 4.99.72 (MIKA) #0: Tue Sep  9 12:01:27 JST 2008  
nand@mika:/w/netbsd/i386/080828/obj/sys/arch/i386/compile/MIKA i386


>Description:
inet_ntop returns NULL for IPv4 mapped address
>How-To-Repeat:
please compile this program and run.
expected: result = ::ffff:192.168.100.200
we got: inet_ntop retunrs NULL

---
#include <stdio.h>
#include <arpa/inet.h>

main()
{
        char addr[256];
        char buffer[256];
        int n;
        const char *r;

        n = inet_pton(AF_INET6, "::FFFF:192.168.100.200", addr);
        r = inet_ntop(AF_INET6, addr, buffer, sizeof(buffer));
        if (r)
                printf("result = %s\n", r);
        else
                printf("inet_ntop retunrs NULL\n");
}
---
>Fix:
I reverted src/lib/libc/inet/inet_ntop.c to 1.5 and the problem seems to be 
fixed here.




Home | Main Index | Thread Index | Old Index