summaryrefslogtreecommitdiff
path: root/source4/lib/stream
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/lib/stream
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/lib/stream')
-rw-r--r--source4/lib/stream/packet.c12
-rw-r--r--source4/lib/stream/packet.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/source4/lib/stream/packet.c b/source4/lib/stream/packet.c
index 3a7f600560..b36d6507ef 100644
--- a/source4/lib/stream/packet.c
+++ b/source4/lib/stream/packet.c
@@ -612,3 +612,15 @@ _PUBLIC_ NTSTATUS packet_full_request_u32(void *private_data, DATA_BLOB blob, si
}
return NT_STATUS_OK;
}
+
+_PUBLIC_ NTSTATUS packet_full_request_u16(void *private_data, DATA_BLOB blob, size_t *size)
+{
+ if (blob.length < 2) {
+ return STATUS_MORE_ENTRIES;
+ }
+ *size = 2 + RSVAL(blob.data, 0);
+ if (*size > blob.length) {
+ return STATUS_MORE_ENTRIES;
+ }
+ return NT_STATUS_OK;
+}
diff --git a/source4/lib/stream/packet.h b/source4/lib/stream/packet.h
index a274bd397c..32c26686c3 100644
--- a/source4/lib/stream/packet.h
+++ b/source4/lib/stream/packet.h
@@ -61,5 +61,6 @@ void packet_queue_run(struct packet_context *pc);
*/
NTSTATUS packet_full_request_nbt(void *private_data, DATA_BLOB blob, size_t *size);
NTSTATUS packet_full_request_u32(void *private_data, DATA_BLOB blob, size_t *size);
+NTSTATUS packet_full_request_u16(void *private_data, DATA_BLOB blob, size_t *size);