*Always* set pinfo->p2p_dir from the wtap_pkthdr.

Don't just do it if we're actually creating protocol tree information
for the "Frame" protocol; that information is used even when we're *not*
creating protocol tree information for "Frame".

Bug: 14245
Change-Id: Ie3754e15754fb6a73529e20d8fa68956e206a994
Reviewed-on: https://code.wireshark.org/review/24593
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2017-11-26 01:31:56 -08:00
parent 78ed5f34f5
commit 7eb2c7dbc7
1 changed files with 14 additions and 6 deletions

View File

@ -232,6 +232,18 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
case REC_TYPE_PACKET:
pinfo->current_proto = "Frame";
if (pinfo->phdr->presence_flags & WTAP_HAS_PACK_FLAGS) {
if (pinfo->phdr->pack_flags & 0x00000001)
pinfo->p2p_dir = P2P_DIR_RECV;
if (pinfo->phdr->pack_flags & 0x00000002)
pinfo->p2p_dir = P2P_DIR_SENT;
}
/*
* If the pseudo-header *and* the packet record both
* have direction information, the pseudo-header
* overrides the packet record.
*/
if (pinfo->pseudo_header != NULL) {
switch (pinfo->pkt_encap) {
@ -364,14 +376,10 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
pinfo->phdr->interface_id);
}
if (pinfo->phdr->presence_flags & WTAP_HAS_PACK_FLAGS) {
if (pinfo->phdr->pack_flags & 0x00000001) {
if (pinfo->phdr->pack_flags & 0x00000001)
proto_item_append_text(ti, " (inbound)");
pinfo->p2p_dir = P2P_DIR_RECV;
}
if (pinfo->phdr->pack_flags & 0x00000002) {
if (pinfo->phdr->pack_flags & 0x00000002)
proto_item_append_text(ti, " (outbound)");
pinfo->p2p_dir = P2P_DIR_SENT;
}
}
fh_tree = proto_item_add_subtree(ti, ett_frame);