NetBSD Problem Report #39519

From www@NetBSD.org  Thu Sep 11 12:57:17 2008
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 418BE63B92A
	for <gnats-bugs@gnats.netbsd.org>; Thu, 11 Sep 2008 12:57:17 +0000 (UTC)
Message-Id: <20080911125717.1793963B853@narn.NetBSD.org>
Date: Thu, 11 Sep 2008 12:57:17 +0000 (UTC)
From: nand@mac.com
Reply-To: nand@mac.com
To: gnats-bugs@NetBSD.org
Subject: inet_ntop returns NULL for IPv4 mapped address
X-Send-Pr-Version: www-1.0

>Number:         39519
>Category:       lib
>Synopsis:       inet_ntop returns NULL for IPv4 mapped address
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 11 13:00:00 +0000 2008
>Closed-Date:    Thu Sep 11 15:41:40 +0000 2008
>Last-Modified:  Thu Sep 11 15:45:01 +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.


>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: christos@NetBSD.org
State-Changed-When: Thu, 11 Sep 2008 11:41:40 -0400
State-Changed-Why:
fixed, thanks


From: Christos Zoulas <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/39519 CVS commit: src/lib/libc/inet
Date: Thu, 11 Sep 2008 15:40:43 +0000 (UTC)

 Module Name:	src
 Committed By:	christos
 Date:		Thu Sep 11 15:40:43 UTC 2008

 Modified Files:
 	src/lib/libc/inet: inet_ntop.c

 Log Message:
 PR/39519: Nozomu Ando: Fix incorrect change from bind9 that broke IPv4 mapped
 addresses.


 To generate a diff of this commit:
 cvs rdiff -r1.6 -r1.7 src/lib/libc/inet/inet_ntop.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.