From nobody@FreeBSD.org  Mon Feb  4 09:32:07 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BA85E16A41B
	for <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <wundram@beenic.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: getaddrinfo() implementation on FreeBSD 7 is incomplete, but no mention in manpage
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         120248
>Category:       docs
>Synopsis:       [patch] getaddrinfo() implementation on FreeBSD 7 is incomplete, but no mention in getaddrinfo.3
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    danger
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 04 09:40:00 UTC 2008
>Closed-Date:    Tue Jan 06 13:12:54 UTC 2009
>Last-Modified:  Tue Jan  6 13:20:00 UTC 2009
>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 <sys/socket.h>
#include <sys/types.h>

#include <netdb.h>
#include <netinet/in.h>
#include <stdio.h>
#include <string.h>


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:
Responsible-Changed-From-To: freebsd-bugs->freebsd-doc 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Feb 5 01:32:06 UTC 2008 
Responsible-Changed-Why:  
Make this a docs PR and note patch. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120248 
Responsible-Changed-From-To: freebsd-doc->danger 
Responsible-Changed-By: danger 
Responsible-Changed-When: Tue Jul 1 22:59:34 UTC 2008 
Responsible-Changed-Why:  
Track 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120248 
State-Changed-From-To: open->patched 
State-Changed-By: danger 
State-Changed-When: Tue Jul 1 22:59:50 UTC 2008 
State-Changed-Why:  
I have committed slightly modified diff, however thank you for your 
submission! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120248 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/120248: commit references a PR
Date: Tue,  1 Jul 2008 22:59:33 +0000 (UTC)

 danger      2008-07-01 22:59:20 UTC
 
   FreeBSD src repository
 
   Modified files:
     lib/libc/net         getaddrinfo.3 
   Log:
   SVN rev 180162 on 2008-07-01 22:59:20Z by danger
   
   - AI_ALL and AI_V4MAPPED flags are currently not supported
   
   PR:             docs/120248
   Submitted by:   Heiko Wundram <wundram (a) beenic.net>
   
   Revision  Changes    Path
   1.34      +18 -1     src/lib/libc/net/getaddrinfo.3
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/120248: commit references a PR
Date: Tue,  6 Jan 2009 13:09:34 +0000 (UTC)

 Author: danger (doc committer)
 Date: Tue Jan  6 13:09:19 2009
 New Revision: 186818
 URL: http://svn.freebsd.org/changeset/base/186818
 
 Log:
   MFC r180162:
   
   - AI_ALL and AI_V4MAPPED flags are currently not supported
   
   PR:		docs/120248
   Submitted by:	Heiko Wundram <wundram (a) beenic.net>
 
 Modified:
   stable/7/lib/libc/   (props changed)
   stable/7/lib/libc/net/getaddrinfo.3
   stable/7/lib/libc/string/ffsll.c   (props changed)
   stable/7/lib/libc/string/flsll.c   (props changed)
 
 Modified: stable/7/lib/libc/net/getaddrinfo.3
 ==============================================================================
 --- stable/7/lib/libc/net/getaddrinfo.3	Tue Jan  6 13:05:58 2009	(r186817)
 +++ stable/7/lib/libc/net/getaddrinfo.3	Tue Jan  6 13:09:19 2009	(r186818)
 @@ -18,7 +18,7 @@
  .\"
  .\" $FreeBSD$
  .\"
 -.Dd June 6, 2007
 +.Dd July 1, 2008
  .Dt GETADDRINFO 3
  .Os
  .Sh NAME
 @@ -237,6 +237,11 @@ flag shall be ignored unless
  .Fa ai_family
  equals
  .Dv AF_INET6 .
 +Note: this flag is currently
 +.Em not
 +supported, see the
 +.Sx BUGS
 +section.
  .El
  .El
  .Pp
 @@ -485,6 +490,18 @@ freeaddrinfo(res0);
  .%B "Proceedings of the freenix track: 2000 USENIX annual technical conference"
  .%D June 2000
  .Re
 +.Sh BUGS
 +The
 +.Nm
 +function as implemented in
 +.Fx
 +currently does not support
 +.Dv AI_ALL
 +and
 +.Dv AI_V4MAPPED
 +flags and returns
 +.Dv EAI_BADFLAGS
 +if one of them is specified.
  .Sh STANDARDS
  The
  .Fn getaddrinfo
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: danger 
State-Changed-When: Tue Jan 6 13:12:31 UTC 2009 
State-Changed-Why:  
now documented in both stable/6 and stable/7 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120248 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/120248: commit references a PR
Date: Tue,  6 Jan 2009 13:12:41 +0000 (UTC)

 Author: danger (doc committer)
 Date: Tue Jan  6 13:12:26 2009
 New Revision: 186820
 URL: http://svn.freebsd.org/changeset/base/186820
 
 Log:
   MFC r180162:
   
   - AI_ALL and AI_V4MAPPED flags are currently not supported
   
   PR:		docs/120248
   Submitted by:	Heiko Wundram <wundram (a) beenic.net>
 
 Modified:
   stable/6/lib/libc/   (props changed)
   stable/6/lib/libc/inet/inet_net_pton.c   (props changed)
   stable/6/lib/libc/net/getaddrinfo.3
   stable/6/lib/libc/sys/   (props changed)
 
 Modified: stable/6/lib/libc/net/getaddrinfo.3
 ==============================================================================
 --- stable/6/lib/libc/net/getaddrinfo.3	Tue Jan  6 13:10:15 2009	(r186819)
 +++ stable/6/lib/libc/net/getaddrinfo.3	Tue Jan  6 13:12:26 2009	(r186820)
 @@ -18,7 +18,7 @@
  .\"
  .\" $FreeBSD$
  .\"
 -.Dd June 6, 2007
 +.Dd July 1, 2008
  .Dt GETADDRINFO 3
  .Os
  .Sh NAME
 @@ -237,6 +237,11 @@ flag shall be ignored unless
  .Fa ai_family
  equals
  .Dv AF_INET6 .
 +Note: this flag is currently
 +.Em not
 +supported, see the
 +.Sx BUGS
 +section.
  .El
  .El
  .Pp
 @@ -485,6 +490,18 @@ freeaddrinfo(res0);
  .%B "Proceedings of the freenix track: 2000 USENIX annual technical conference"
  .%D June 2000
  .Re
 +.Sh BUGS
 +The
 +.Nm
 +function as implemented in
 +.Fx
 +currently does not support
 +.Dv AI_ALL
 +and
 +.Dv AI_V4MAPPED
 +flags and returns
 +.Dv EAI_BADFLAGS
 +if one of them is specified.
  .Sh STANDARDS
  The
  .Fn getaddrinfo
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
