aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>2006-08-22 19:42:04 +0000
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>2006-08-22 19:42:04 +0000
commit804141e766b12eed06e7ea42db7c7f8208ada810 (patch)
tree870bd3d93815d1d6f04dc4fbf685b349d3725084 /plugins
parent29331b9537c7c4b9a5dfa9d36bfd2b1bc48e28ea (diff)
fix TLB block alignment to be compatible with the current MRP draft. Would be nice if included in the 0.99.3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18996 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'plugins')
-rw-r--r--plugins/profinet/packet-pn-mrp.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/plugins/profinet/packet-pn-mrp.c b/plugins/profinet/packet-pn-mrp.c
index e6cd8b49f0..12f4e92f52 100644
--- a/plugins/profinet/packet-pn-mrp.c
+++ b/plugins/profinet/packet-pn-mrp.c
@@ -306,17 +306,23 @@ dissect_PNMRP_PDU(tvbuff_t *tvb, int offset,
guint8 length;
gint i = 0;
proto_item *unknown_item;
+ tvbuff_t *tvb_new;
/* MRP_Version */
offset = dissect_pn_uint16(tvb, offset, pinfo, tree, hf_pn_mrp_version, &version);
+ /* the rest of the packet has 4byte alignment regarding to the beginning of the next TLV block! */
+ /* XXX - do we have to free this new tvb below? */
+ tvb_new = tvb_new_subset(tvb, offset, -1, -1);
+ offset = 0;
+
while(tvb_length_remaining(tvb, offset) > 0) {
/* MRP_TLVHeader.Type */
- offset = dissect_pn_uint8(tvb, offset, pinfo, tree, hf_pn_mrp_type, &type);
+ offset = dissect_pn_uint8(tvb_new, offset, pinfo, tree, hf_pn_mrp_type, &type);
/* MRP_TLVHeader.Length */
- offset = dissect_pn_uint8(tvb, offset, pinfo, tree, hf_pn_mrp_length, &length);
+ offset = dissect_pn_uint8(tvb_new, offset, pinfo, tree, hf_pn_mrp_length, &length);
if(i != 0) {
if (check_col(pinfo->cinfo, COL_INFO))
@@ -336,22 +342,22 @@ dissect_PNMRP_PDU(tvbuff_t *tvb, int offset,
return offset;
break;
case(0x01):
- offset = dissect_PNMRP_Common(tvb, offset, pinfo, tree, item);
+ offset = dissect_PNMRP_Common(tvb_new, offset, pinfo, tree, item);
break;
case(0x02):
- offset = dissect_PNMRP_Test(tvb, offset, pinfo, tree, item);
+ offset = dissect_PNMRP_Test(tvb_new, offset, pinfo, tree, item);
break;
case(0x03):
- offset = dissect_PNMRP_TopologyChange(tvb, offset, pinfo, tree, item);
+ offset = dissect_PNMRP_TopologyChange(tvb_new, offset, pinfo, tree, item);
break;
case(0x04):
- offset = dissect_PNMRP_LinkDown(tvb, offset, pinfo, tree, item);
+ offset = dissect_PNMRP_LinkDown(tvb_new, offset, pinfo, tree, item);
break;
case(0x05):
- offset = dissect_PNMRP_LinkUp(tvb, offset, pinfo, tree, item);
+ offset = dissect_PNMRP_LinkUp(tvb_new, offset, pinfo, tree, item);
break;
default:
- unknown_item = proto_tree_add_string_format(tree, hf_pn_mrp_data, tvb, offset, length, "data",
+ unknown_item = proto_tree_add_string_format(tree, hf_pn_mrp_data, tvb_new, offset, length, "data",
"PN-MRP Unknown TLVType 0x%x, Data: %d bytes", type, length);
expert_add_info_format(pinfo, unknown_item, PI_UNDECODED, PI_WARN,
"Unknown TLVType 0x%x, %u bytes",