diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-11-26 01:31:56 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-11-26 09:32:31 +0000 |
commit | 7eb2c7dbc7b0cddb18297268677e3dc9a073f320 (patch) | |
tree | e705aed5f22eb1f2d12a1c6114222d8e7c7dd08a | |
parent | 78ed5f34f574d6400e63b7f8c4f358c7c69a24fa (diff) |
*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>
-rw-r--r-- | epan/dissectors/packet-frame.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c index 9310bf7c72..bfce974f17 100644 --- a/epan/dissectors/packet-frame.c +++ b/epan/dissectors/packet-frame.c @@ -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); |