summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/kdc/kdc.c43
1 files changed, 2 insertions, 41 deletions
diff --git a/source4/kdc/kdc.c b/source4/kdc/kdc.c
index b2921842e7..93f1c7d6ec 100644
--- a/source4/kdc/kdc.c
+++ b/source4/kdc/kdc.c
@@ -73,9 +73,6 @@ struct kdc_tcp_connection {
/* the kdc_server the connection belongs to */
struct kdc_socket *kdc_socket;
- struct tsocket_address *local_address;
- struct tsocket_address *remote_address;
-
struct packet_context *packet;
};
@@ -104,8 +101,8 @@ static NTSTATUS kdc_tcp_recv(void *private_data, DATA_BLOB blob)
tmp_ctx,
&input,
&reply,
- kdcconn->remote_address,
- kdcconn->local_address,
+ kdcconn->conn->remote_address,
+ kdcconn->conn->local_address,
0 /* Not datagram */);
if (!ret) {
talloc_free(tmp_ctx);
@@ -224,9 +221,6 @@ static void kdc_tcp_accept(struct stream_connection *conn)
{
struct kdc_socket *kdc_socket = talloc_get_type(conn->private_data, struct kdc_socket);
struct kdc_tcp_connection *kdcconn;
- struct socket_address *src_addr;
- struct socket_address *my_addr;
- int ret;
kdcconn = talloc_zero(conn, struct kdc_tcp_connection);
if (!kdcconn) {
@@ -237,39 +231,6 @@ static void kdc_tcp_accept(struct stream_connection *conn)
kdcconn->kdc_socket = kdc_socket;
conn->private_data = kdcconn;
- src_addr = socket_get_peer_addr(kdcconn->conn->socket, kdcconn);
- if (!src_addr) {
- kdc_tcp_terminate_connection(kdcconn, "kdc_tcp_accept: out of memory");
- return;
- }
-
- my_addr = socket_get_my_addr(kdcconn->conn->socket, kdcconn);
- if (!my_addr) {
- kdc_tcp_terminate_connection(kdcconn, "kdc_tcp_accept: out of memory");
- return;
- }
-
- ret = tsocket_address_bsd_from_sockaddr(kdcconn,
- src_addr->sockaddr,
- src_addr->sockaddrlen,
- &kdcconn->remote_address);
- if (ret < 0) {
- kdc_tcp_terminate_connection(kdcconn, "kdc_tcp_accept: out of memory");
- return;
- }
-
- ret = tsocket_address_bsd_from_sockaddr(kdcconn,
- my_addr->sockaddr,
- my_addr->sockaddrlen,
- &kdcconn->local_address);
- if (ret < 0) {
- kdc_tcp_terminate_connection(kdcconn, "kdc_tcp_accept: out of memory");
- return;
- }
-
- TALLOC_FREE(src_addr);
- TALLOC_FREE(my_addr);
-
kdcconn->packet = packet_init(kdcconn);
if (kdcconn->packet == NULL) {
kdc_tcp_terminate_connection(kdcconn, "kdc_tcp_accept: out of memory");