Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[ipv6] Add support for resolving IPv6 addresses via the "nslookup" co…
…mmand

Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Dec 5, 2013
1 parent 44a0dc7 commit 2f1c7e3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/usr/nslookup.c
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 2f1c7e3

Please sign in to comment.