From nobody@FreeBSD.org  Sat Oct  6 11:06:36 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 1D411106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  6 Oct 2012 11:06:36 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 07CD68FC16
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  6 Oct 2012 11:06:36 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q96B6ZTB071395
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 6 Oct 2012 11:06:35 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id q96B6Z3A071394;
	Sat, 6 Oct 2012 11:06:35 GMT
	(envelope-from nobody)
Message-Id: <201210061106.q96B6Z3A071394@red.freebsd.org>
Date: Sat, 6 Oct 2012 11:06:35 GMT
From: Antonio Querubin <tony@lavanauts.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: __res_state_ext missing from system headers
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         172390
>Category:       kern
>Synopsis:       [headers] __res_state_ext missing from system headers
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 06 11:10:13 UTC 2012
>Closed-Date:    
>Last-Modified:  Sun Oct 14 23:29:11 UTC 2012
>Originator:     Antonio Querubin
>Release:        9.0
>Organization:
>Environment:
FreeBSD vm2 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:15:25 UTC 2012     root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
Programs that use the resolver library but query IPv6 resolvers directly require access to the IPv6 extensions in resolv.h.  However, the definition for struct __res_state_ext is missing from the standard system header files.
>How-To-Repeat:
The following will fail to compile:

#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>

int main(void) {
  struct __res_state myres;
  struct __res_state_ext *myres6;
  struct sockaddr_in6 *mysockaddr6;

  res_ninit(&myres);
  myres6 = myres._u._ext.ext;
  mysockaddr6 = &(myres6->nsaddrs[0].sin6); 
}

>Fix:
Include a definition for struct __res_state_ext in resolv.h

struct __res_state_ext {
        union res_sockaddr_union nsaddrs[MAXNS];
        struct sort_list {
                int     af;
                union {
                        struct in_addr  ina;
                        struct in6_addr in6a;
                } addr, mask;
        } sort_list[MAXRESOLVSORT];
        char nsuffix[64];
        char nsuffix2[64];
};


>Release-Note:
>Audit-Trail:
>Unformatted:
