Browse Source

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

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 11 years ago
parent
commit
2f1c7e386b
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      src/usr/nslookup.c

+ 7
- 0
src/usr/nslookup.c View File

@@ -71,6 +71,7 @@ static void nslookup_close ( struct nslookup *nslookup, int rc ) {
71 71
 static void nslookup_resolv_done ( struct nslookup *nslookup,
72 72
 				   struct sockaddr *sa ) {
73 73
 	struct sockaddr_in *sin;
74
+	struct sockaddr_in6 *sin6;
74 75
 	const struct setting_type *default_type;
75 76
 	struct settings *settings;
76 77
 	struct setting setting;
@@ -86,6 +87,12 @@ static void nslookup_resolv_done ( struct nslookup *nslookup,
86 87
 		len = sizeof ( sin->sin_addr );
87 88
 		default_type = &setting_type_ipv4;
88 89
 		break;
90
+	case AF_INET6:
91
+		sin6 = ( ( struct sockaddr_in6 * ) sa );
92
+		data = &sin6->sin6_addr;
93
+		len = sizeof ( sin6->sin6_addr );
94
+		default_type = &setting_type_ipv6;
95
+		break;
89 96
 	default:
90 97
 		rc = -ENOTSUP;
91 98
 		goto err;

Loading…
Cancel
Save