Bug 172390 - [headers] __res_state_ext missing from system headers
Summary: [headers] __res_state_ext missing from system headers
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-06 12:10 UTC by Antonio Querubin
Modified: 2017-12-31 22:29 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antonio Querubin 2012-10-06 12:10:13 UTC
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.

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];
};
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); 
}
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:58:29 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped