aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/file-pcapng.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2015-08-20 15:06:41 +0200
committerPascal Quantin <pascal.quantin@gmail.com>2015-08-21 08:34:28 +0000
commiteeafab579e576dfc55641d3aba3882aef4e34098 (patch)
tree6506f25b4bbabf216621f81ff1ed05bfa96e0fe3 /epan/dissectors/file-pcapng.c
parent5e3388f85d660bd9a8aac868436b5deb0e946cbf (diff)
file-pcapng: always set pinfo->fd->num before calling next layer dissectors/file-pcapng
Also fix an off by 1 error for EPB case Change-Id: I895d82a58ec02c577dcaa67a97d456b42460b947 Reviewed-on: https://code.wireshark.org/review/10149 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/file-pcapng.c')
-rw-r--r--epan/dissectors/file-pcapng.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/epan/dissectors/file-pcapng.c b/epan/dissectors/file-pcapng.c
index 8ec518a6ba..b0267a9d7a 100644
--- a/epan/dissectors/file-pcapng.c
+++ b/epan/dissectors/file-pcapng.c
@@ -1143,7 +1143,6 @@ static gint dissect_block(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
break;
case BLOCK_PACKET:
proto_item_append_text(block_item, " %u", info->frame_number);
- info->frame_number += 1;
proto_tree_add_item(block_data_tree, hf_pcapng_packet_block_interface_id, tvb, offset, 2, encoding);
interface_id = tvb_get_guint16(tvb, offset, encoding);
@@ -1167,6 +1166,8 @@ static gint dissect_block(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
struct interface_description *interface_description;
proto_tree *packet_data_tree = proto_item_add_subtree(packet_data_item, ett_pcapng_packet_data);
+ pinfo->fd->num = info->frame_number;
+
interface_description = (struct interface_description *) wmem_array_index(info->interfaces, interface_id);
TRY {
call_dissector_with_data(pcap_pseudoheader_handle, tvb_new_subset(tvb, offset, captured_length, reported_length),
@@ -1177,6 +1178,7 @@ static gint dissect_block(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
}
ENDTRY;
}
+ info->frame_number += 1;
offset += captured_length;
if (captured_length % 4) {
@@ -1190,7 +1192,6 @@ static gint dissect_block(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
break;
case BLOCK_SIMPLE_PACKET:
proto_item_append_text(block_item, " %u", info->frame_number);
- info->frame_number += 1;
proto_tree_add_item_ret_uint(block_data_tree, hf_pcapng_packet_length, tvb, offset, 4, encoding, &captured_length);
offset += 4;
@@ -1203,6 +1204,8 @@ static gint dissect_block(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
struct interface_description *interface_description;
proto_tree *packet_data_tree = proto_item_add_subtree(packet_data_item, ett_pcapng_packet_data);
+ pinfo->fd->num = info->frame_number;
+
interface_description = (struct interface_description *) wmem_array_index(info->interfaces, interface_id);
TRY {
call_dissector_with_data(pcap_pseudoheader_handle, tvb_new_subset_length(tvb, offset, captured_length),
@@ -1213,6 +1216,7 @@ static gint dissect_block(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
}
ENDTRY;
}
+ info->frame_number += 1;
offset += captured_length;
if (captured_length % 4) {
@@ -1345,7 +1349,6 @@ static gint dissect_block(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
break;
case BLOCK_ENHANCED_PACKET:
proto_item_append_text(block_item, " %u", info->frame_number);
- info->frame_number += 1;
proto_tree_add_item(block_data_tree, hf_pcapng_interface_id, tvb, offset, 4, encoding);
interface_id = tvb_get_guint32(tvb, offset, encoding);
@@ -1378,6 +1381,7 @@ static gint dissect_block(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
}
ENDTRY;
}
+ info->frame_number += 1;
offset += captured_length;
if (captured_length % 4) {