2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Move isc_socket_getsockname() calls into dispatch

We now use dns_dispentry_getlocaladdress(). (this API is likely to be
cleaned up further later.)
This commit is contained in:
Evan Hunt
2021-01-04 14:38:35 -08:00
parent 9f9a327b22
commit 655e7fcacc
3 changed files with 38 additions and 10 deletions

View File

@@ -2678,6 +2678,23 @@ dns_dispatch_getlocaladdress(dns_dispatch_t *disp, isc_sockaddr_t *addrp) {
return (ISC_R_NOTIMPLEMENTED);
}
isc_result_t
dns_dispentry_getlocaladdress(dns_dispentry_t *resp, isc_sockaddr_t *addrp) {
REQUIRE(VALID_RESPONSE(resp));
REQUIRE(addrp != NULL);
if (resp->disp->socktype == isc_sockettype_tcp) {
return (isc_socket_getsockname(resp->disp->socket, addrp));
}
if (resp->dispsocket != NULL) {
return (isc_socket_getsockname(resp->dispsocket->socket,
addrp));
}
return (ISC_R_NOTIMPLEMENTED);
}
unsigned int
dns_dispatch_getattributes(dns_dispatch_t *disp) {
REQUIRE(VALID_DISPATCH(disp));