summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
diff options
context:
space:
mode:
authorRonnie Sahlberg <sahlberg@samba.org>2007-07-05 07:19:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:59:08 -0500
commit7bf94150dac76fac39fe0999afe1d596970c5bb4 (patch)
tree8d1a3d3c173d55f5e928cf2d1bcec37cc0327632 /source4/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
parent967866f17084df7a78ed6ecfcb9d2b31deaa28a1 (diff)
downloadsamba-7bf94150dac76fac39fe0999afe1d596970c5bb4.tar.gz
samba-7bf94150dac76fac39fe0999afe1d596970c5bb4.tar.bz2
samba-7bf94150dac76fac39fe0999afe1d596970c5bb4.zip
r23721: For unions, The TAG and the ARM are aligned independently.
Move emitting ALIGN_TO_x_BYTES to after the tag has been dissected so the alignment only affects the ARM. (This used to be commit 22945854d91c87cc17df681db5fd3c6871cdaadc)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Wireshark/NDR.pm')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Wireshark/NDR.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/source4/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
index ac923bef74..ffe104c941 100644
--- a/source4/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
+++ b/source4/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
@@ -614,12 +614,6 @@ sub Union($$$$)
$self->pidl_code("$switch_type level;");
$self->pidl_code("");
- if ($e->{ALIGN} > 1) {
- $self->pidl_code("ALIGN_TO_$e->{ALIGN}_BYTES;");
- }
-
- $self->pidl_code("");
-
$self->pidl_code("old_offset = offset;");
$self->pidl_code("if (parent_tree) {");
$self->indent;
@@ -632,6 +626,12 @@ sub Union($$$$)
$self->pidl_code("offset = $switch_dissect(tvb, offset, pinfo, tree, drep, hf_index, &level);");
+ if ($e->{ALIGN} > 1) {
+ $self->pidl_code("ALIGN_TO_$e->{ALIGN}_BYTES;");
+ $self->pidl_code("");
+ }
+
+
$self->pidl_code("switch(level) {$res\t}");
$self->pidl_code("proto_item_set_len(item, offset-old_offset);\n");
$self->pidl_code("return offset;");