summaryrefslogtreecommitdiff
path: root/source4/kdc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-12-23 11:16:32 +0100
committerStefan Metzmacher <metze@samba.org>2009-12-24 17:38:33 +0100
commit5126b52810628bb8d37a7d7768beb18771c4330f (patch)
treeecfb3fec2714548d2b63d2ed316054be4d274225 /source4/kdc
parent500f55ca92efe0235758b131a33bc1645c0545ac (diff)
downloadsamba-5126b52810628bb8d37a7d7768beb18771c4330f.tar.gz
samba-5126b52810628bb8d37a7d7768beb18771c4330f.tar.bz2
samba-5126b52810628bb8d37a7d7768beb18771c4330f.zip
s4:kdc: use the remote and local address from the stream_connection struct
metze
Diffstat (limited to 'source4/kdc')
-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");