]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[ipv6] Add support for resolving IPv6 addresses via the "nslookup" command
authorMichael Brown <mcb30@ipxe.org>
Thu, 5 Dec 2013 01:52:34 +0000 (01:52 +0000)
committerMichael Brown <mcb30@ipxe.org>
Thu, 5 Dec 2013 01:53:25 +0000 (01:53 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/usr/nslookup.c

index 66818d11b25edb44812e892fd27e4b159531b8c2..eb2b08b426a1b16f62bb9ecc3b7eadd90f40ec83 100644 (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;