summaryrefslogtreecommitdiff
path: root/plugins/profinet
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2006-08-22 19:42:04 +0000
committerUlf Lamping <ulf.lamping@web.de>2006-08-22 19:42:04 +0000
commitc91dd2c6c2fa45250070f25dbe806c87c365961d (patch)
tree870bd3d93815d1d6f04dc4fbf685b349d3725084 /plugins/profinet
parentba718fb33ce91e9b2038c2f63335df32c1688799 (diff)
downloadwireshark-c91dd2c6c2fa45250070f25dbe806c87c365961d.tar.gz
fix TLB block alignment to be compatible with the current MRP draft. Would be nice if included in the 0.99.3
svn path=/trunk/; revision=18996
Diffstat (limited to 'plugins/profinet')
-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",