diff -ur bind-9.2.4.orig/bin/named/client.c bind-9.2.4/bin/named/client.c --- bind-9.2.4.orig/bin/named/client.c Fri Jul 23 04:56:59 2004 +++ bind-9.2.4/bin/named/client.c Sat Dec 18 19:56:38 2004 @@ -1299,35 +1299,15 @@ } /* - * Determine the destination address. For TCP/IPv6, we get this from - * the receiving socket. For UDP/IPv6, we get it from the pktinfo - * structure (if supported). For IPv4, we have to do with + * Determine the destination address. For IPv6, we get this from the + * pktinfo structure (if supported). For IPv4, we have to make do with * the address of the interface where the request was received. */ if (client->interface->addr.type.sa.sa_family == AF_INET6) { - result = ISC_R_FAILURE; - - if (TCP_CLIENT(client)) { - isc_sockaddr_t destsockaddr; - - result = isc_socket_getsockname(client->tcpsocket, - &destsockaddr); - if (result == ISC_R_SUCCESS) - isc_netaddr_fromsockaddr(&destaddr, - &destsockaddr); - } - if (result != ISC_R_SUCCESS && - (client->attributes & NS_CLIENTATTR_PKTINFO) != 0) { + if ((client->attributes & NS_CLIENTATTR_PKTINFO) != 0) isc_netaddr_fromin6(&destaddr, &client->pktinfo.ipi6_addr); - result = ISC_R_SUCCESS; - } - if (result != ISC_R_SUCCESS) { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "failed to get request's " - "destination: %s", - isc_result_totext(result)); - goto cleanup; - } + else + isc_netaddr_any6(&destaddr); } else { isc_netaddr_fromsockaddr(&destaddr, &client->interface->addr); }