misc/172390: __res_state_ext missing from system headers
Antonio Querubin
tony at lavanauts.org
Sat Oct 6 11:10:17 UTC 2012
>Number: 172390
>Category: misc
>Synopsis: __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:
>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 at 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:
More information about the freebsd-bugs
mailing list