From owner-freebsd-bugs@FreeBSD.ORG Mon Feb 4 09:40:01 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12BCB16A419 for ; Mon, 4 Feb 2008 09:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E31FD13C455 for ; Mon, 4 Feb 2008 09:40:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m149e0OS011476 for ; Mon, 4 Feb 2008 09:40:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m149e0nS011475; Mon, 4 Feb 2008 09:40:00 GMT (envelope-from gnats) Resent-Date: Mon, 4 Feb 2008 09:40:00 GMT Resent-Message-Id: <200802040940.m149e0nS011475@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Heiko Wundram Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA85E16A41B for ; Mon, 4 Feb 2008 09:32:07 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id A59DF13C47E for ; Mon, 4 Feb 2008 09:32:07 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m149U9Tm044769 for ; Mon, 4 Feb 2008 09:30:09 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m149U9Fj044768; Mon, 4 Feb 2008 09:30:09 GMT (envelope-from nobody) Message-Id: <200802040930.m149U9Fj044768@www.freebsd.org> Date: Mon, 4 Feb 2008 09:30:09 GMT From: Heiko Wundram To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/120248: getaddrinfo() implementation on FreeBSD 7 is incomplete, but no mention in manpage X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2008 09:40:01 -0000 >Number: 120248 >Category: misc >Synopsis: getaddrinfo() implementation on FreeBSD 7 is incomplete, but no mention in manpage >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Mon Feb 04 09:40:00 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Heiko Wundram >Release: FreeBSD 7.0-PRERELEASE >Organization: Beenic Networks GmbH >Environment: FreeBSD phoenix.modelnine.org 7.0-PRERELEASE FreeBSD 7.0-PRERELEASE #0: Sat Feb 2 22:23:33 CET 2008 root@phoenix.modelnine.org:/usr/obj/usr/src/sys/HEIKO i386 >Description: The getaddrinfo()-function as implemented in FreeBSD's libc is incomplete, as it is missing support for AI_ALL and AI_V4MAPPED. These flags are nevertheless documented in the manpage for the function, and no mention is given to the deficiency (because getaddrinfo() simply returns EAI_BADFLAGS, this is more than misleading). The attached patch resolves the documentation bug. >How-To-Repeat: Compile and run the following test program: --- #include #include #include #include #include #include int main(int argc, char** argv) { struct addrinfo hints; struct addrinfo* res; int rv; memset(&hints,0,sizeof(hints)); hints.ai_flags = AI_V4MAPPED; hints.ai_family = AF_INET6; hints.ai_socktype = SOCK_STREAM; if( ( rv = getaddrinfo("www.kame.net","http",&hints,&res) ) ) { printf("Error: %s.\n",gai_strerror(rv)); return 1; } printf("Got address(es)\n"); freeaddrinfo(res); return 0; } --- This should print "Got address(es)," but instead prints "Error: Invalid value for ai_flags," which is non-conformant to the documentation. >Fix: See the attached patch to add documentation that the flags AI_V4MAPPED and AI_ALL aren't implemented. Patch attached with submission follows: --- /usr/src/lib/libc/net/getaddrinfo.3 2007-10-20 12:06:39.000000000 +0200 +++ man3/getaddrinfo.3 2008-02-04 10:22:31.000000000 +0100 @@ -493,3 +493,11 @@ specification and documented in .Dv "RFC 3493" , .Dq Basic Socket Interface Extensions for IPv6 . +.Sh BUGS +The getaddrinfo function as implemented in FreeBSD currently does not support +.Dv AI_ALL +and +.Dv AI_V4MAPPED , +and returns +.Dv EAI_BADFLAGS +if you specify one of them. >Release-Note: >Audit-Trail: >Unformatted: