david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[ipv6] Add support for resolving IPv6 addresses via the "nslookup" command

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2013-12-05 01:52:34 +00:00
parent 44a0dc7848
commit 2f1c7e386b
1 changed files with 7 additions and 0 deletions

View File

@ -71,6 +71,7 @@ static void nslookup_close ( struct nslookup *nslookup, int rc ) {
static void nslookup_resolv_done ( struct nslookup *nslookup,
struct sockaddr *sa ) {
struct sockaddr_in *sin;
struct sockaddr_in6 *sin6;
const struct setting_type *default_type;
struct settings *settings;
struct setting setting;
@ -86,6 +87,12 @@ static void nslookup_resolv_done ( struct nslookup *nslookup,
len = sizeof ( sin->sin_addr );
default_type = &setting_type_ipv4;
break;
case AF_INET6:
sin6 = ( ( struct sockaddr_in6 * ) sa );
data = &sin6->sin6_addr;
len = sizeof ( sin6->sin6_addr );
default_type = &setting_type_ipv6;
break;
default:
rc = -ENOTSUP;
goto err;