summaryrefslogtreecommitdiff
path: root/source4/dns_server
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2012-03-06 08:49:16 +0100
committerKai Blin <kai@samba.org>2012-03-06 21:17:18 +0100
commitc7f67142c0693e73355e1a5748f729fad04415e0 (patch)
treea44bbc53f4e11ceec373002e355c416c10b53895 /source4/dns_server
parent1f62df52aaafc4f777fed4541625a92f15c8e12c (diff)
downloadsamba-c7f67142c0693e73355e1a5748f729fad04415e0.tar.gz
samba-c7f67142c0693e73355e1a5748f729fad04415e0.tar.bz2
samba-c7f67142c0693e73355e1a5748f729fad04415e0.zip
s4 dns: Fix TCP handling in the DNS server
Autobuild-User: Kai Blin <kai@samba.org> Autobuild-Date: Tue Mar 6 21:17:19 CET 2012 on sn-devel-104
Diffstat (limited to 'source4/dns_server')
-rw-r--r--source4/dns_server/dns_server.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/source4/dns_server/dns_server.c b/source4/dns_server/dns_server.c
index 25873c2bf4..cf43590b63 100644
--- a/source4/dns_server/dns_server.c
+++ b/source4/dns_server/dns_server.c
@@ -233,13 +233,13 @@ static void dns_tcp_call_loop(struct tevent_req *subreq)
return;
}
- DEBUG(10,("Received krb5 TCP packet of length %lu from %s\n",
+ DEBUG(10,("Received DNS TCP packet of length %lu from %s\n",
(long) call->in.length,
tsocket_address_string(dns_conn->conn->remote_address, call)));
/* skip length header */
- call->in.data += 4;
- call->in.length -= 4;
+ call->in.data += 2;
+ call->in.length -= 2;
/* Call dns */
status = dns_process(dns_conn->dns_socket->dns, call, &call->in, &call->out);
@@ -251,9 +251,9 @@ static void dns_tcp_call_loop(struct tevent_req *subreq)
}
/* First add the length of the out buffer */
- RSIVAL(call->out_hdr, 0, call->out.length);
+ RSSVAL(call->out_hdr, 0, call->out.length);
call->out_iov[0].iov_base = (char *) call->out_hdr;
- call->out_iov[0].iov_len = 4;
+ call->out_iov[0].iov_len = 2;
call->out_iov[1].iov_base = (char *) call->out.data;
call->out_iov[1].iov_len = call->out.length;
@@ -271,14 +271,14 @@ static void dns_tcp_call_loop(struct tevent_req *subreq)
tevent_req_set_callback(subreq, dns_tcp_call_writev_done, call);
/*
- * The krb5 tcp pdu's has the length as 4 byte (initial_read_size),
- * packet_full_request_u32 provides the pdu length then.
+ * The dns tcp pdu's has the length as 2 byte (initial_read_size),
+ * packet_full_request_u16 provides the pdu length then.
*/
subreq = tstream_read_pdu_blob_send(dns_conn,
dns_conn->conn->event.ctx,
dns_conn->tstream,
- 4, /* initial_read_size */
- packet_full_request_u32,
+ 2, /* initial_read_size */
+ packet_full_request_u16,
dns_conn);
if (subreq == NULL) {
dns_tcp_terminate_connection(dns_conn, "dns_tcp_call_loop: "
@@ -358,14 +358,14 @@ static void dns_tcp_accept(struct stream_connection *conn)
conn->private_data = dns_conn;
/*
- * The krb5 tcp pdu's has the length as 4 byte (initial_read_size),
- * packet_full_request_u32 provides the pdu length then.
+ * The dns tcp pdu's has the length as 2 byte (initial_read_size),
+ * packet_full_request_u16 provides the pdu length then.
*/
subreq = tstream_read_pdu_blob_send(dns_conn,
dns_conn->conn->event.ctx,
dns_conn->tstream,
- 4, /* initial_read_size */
- packet_full_request_u32,
+ 2, /* initial_read_size */
+ packet_full_request_u16,
dns_conn);
if (subreq == NULL) {
dns_tcp_terminate_connection(dns_conn, "dns_tcp_accept: "