diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-03-01 14:20:32 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-03-01 17:11:03 +0100 |
commit | ef224aa004d5f1726d8dca020e0ef96d8c58565e (patch) | |
tree | aaf68e35b75212949b3959d8fbd3aa8f6f6f4da7 /librpc/ndr/ndr.c | |
parent | 0b5719f5fce6c7069c2faac72c83c20bb22db09f (diff) | |
download | samba-ef224aa004d5f1726d8dca020e0ef96d8c58565e.tar.gz samba-ef224aa004d5f1726d8dca020e0ef96d8c58565e.tar.bz2 samba-ef224aa004d5f1726d8dca020e0ef96d8c58565e.zip |
librpc/ndr: handle NOALIGN flag for relative pointers and alignment DATA_BLOBs
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Mar 1 17:11:03 CET 2011 on sn-devel-104
Diffstat (limited to 'librpc/ndr/ndr.c')
-rw-r--r-- | librpc/ndr/ndr.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/librpc/ndr/ndr.c b/librpc/ndr/ndr.c index e7850d31df..cfeb231487 100644 --- a/librpc/ndr/ndr.c +++ b/librpc/ndr/ndr.c @@ -1191,7 +1191,9 @@ _PUBLIC_ enum ndr_err_code ndr_push_relative_ptr2_start(struct ndr_push *ndr, co relative_offset = ndr->offset - ndr->relative_base_offset; - if (ndr->flags & LIBNDR_FLAG_ALIGN2) { + if (ndr->flags & LIBNDR_FLAG_NOALIGN) { + align = 1; + } else if (ndr->flags & LIBNDR_FLAG_ALIGN2) { align = 2; } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) { align = 4; @@ -1270,7 +1272,9 @@ _PUBLIC_ enum ndr_err_code ndr_push_relative_ptr2_end(struct ndr_push *ndr, cons /* the reversed offset is at the end of the main buffer */ correct_offset = ndr->relative_end_offset - len; - if (ndr->flags & LIBNDR_FLAG_ALIGN2) { + if (ndr->flags & LIBNDR_FLAG_NOALIGN) { + align = 1; + } else if (ndr->flags & LIBNDR_FLAG_ALIGN2) { align = 2; } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) { align = 4; |