[dns] Add support for resolving IPv6 addresses via AAAA records

Our policy is to prefer IPv6 addreses to IPv4 addresses, but to
request IPv6 addresses only if we have an IPv6 address for the name
server itself.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2013-12-04 22:21:47 +00:00
parent 60c4e62e5d
commit 6248894f52
4 changed files with 112 additions and 36 deletions

View File

@@ -147,10 +147,10 @@ struct dhcpv6_user_class_option {
#define DHCPV6_USER_CLASS 15
/** DHCPv6 DNS recursive name server option */
#define DHCPV6_DNS_SERVER 23
#define DHCPV6_DNS_SERVERS 23
/** DHCPv6 domain search list option */
#define DHCPV6_DOMAIN_SEARCH 24
#define DHCPV6_DOMAIN_LIST 24
/**
* Any DHCPv6 option

View File

@@ -19,6 +19,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#define DNS_TYPE_A 1
#define DNS_TYPE_CNAME 5
#define DNS_TYPE_AAAA 28
#define DNS_TYPE_ANY 255
#define DNS_CLASS_IN 1
@@ -78,6 +79,11 @@ struct dns_rr_info_a {
struct in_addr in_addr;
} __attribute__ (( packed ));
struct dns_rr_info_aaaa {
struct dns_rr_info_common common;
struct in6_addr in6_addr;
} __attribute__ (( packed ));
struct dns_rr_info_cname {
struct dns_rr_info_common common;
char cname[0];
@@ -86,6 +92,7 @@ struct dns_rr_info_cname {
union dns_rr_info {
struct dns_rr_info_common common;
struct dns_rr_info_a a;
struct dns_rr_info_aaaa aaaa;
struct dns_rr_info_cname cname;
};