diff options
author | AndersBroman <anders.broman@ericsson.com> | 2016-01-20 15:13:59 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-01-21 13:56:55 +0000 |
commit | dede3c826efc950fa219c346e7a6ca0f63ba5d5e (patch) | |
tree | bd768c1f6371b098c5324001724e2182d3694b9f /epan/dissectors/packet-vlan.c | |
parent | 2d6e044b8d31123692a27bf1943c8000903c7a77 (diff) |
Add VLAN ID to pinfo
I have traces where IP reassembly gets confused by multiple frames from
different VLANS and ends up adding fragments from differet messages
togeter after IP Identification is reused.
I think VLAN ID could be useful in other places too to aviliate duplicate
packet detection. Making this a separate patch while testing the usage.
Change-Id: Id7c23dc52f6de2e1f2e980ec8fe61d0598500d0d
Reviewed-on: https://code.wireshark.org/review/13452
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-vlan.c')
-rw-r--r-- | epan/dissectors/packet-vlan.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/epan/dissectors/packet-vlan.c b/epan/dissectors/packet-vlan.c index ea0c66fe2e..05ba381dac 100644 --- a/epan/dissectors/packet-vlan.c +++ b/epan/dissectors/packet-vlan.c @@ -137,7 +137,7 @@ static int dissect_vlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_item *ti; - guint16 tci; + guint16 tci, vlan_id; guint16 encap_proto; gboolean is_802_2; proto_tree *vlan_tree; @@ -146,6 +146,11 @@ dissect_vlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ col_clear(pinfo->cinfo, COL_INFO); tci = tvb_get_ntohs( tvb, 0 ); + vlan_id = tci & 0xFFF; + /* Add the VLAN Id if it's the first one*/ + if (pinfo->vlan_id == 0) { + pinfo->vlan_id = vlan_id; + } columns_set_vlan(pinfo->cinfo, tci); @@ -156,7 +161,7 @@ dissect_vlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ if (vlan_summary_in_tree) { proto_item_append_text(ti, ", PRI: %u, CFI: %u, ID: %u", - (tci >> 13), ((tci >> 12) & 1), (tci & 0xFFF)); + (tci >> 13), ((tci >> 12) & 1), vlan_id); } vlan_tree = proto_item_add_subtree(ti, ett_vlan); |