summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-07-26 23:16:16 +0000
committerEvan Huus <eapache@gmail.com>2013-07-26 23:16:16 +0000
commitd22919194acb88b4ddbcc26c1711bee4d8132057 (patch)
tree031d6f4a65c793dda11db6d18640c47e7ffed7ae
parentc0cac8611e76c1da811158003011d53c2420a40e (diff)
downloadwireshark-d22919194acb88b4ddbcc26c1711bee4d8132057.tar.gz
Switch on field length for the length_min/max fields of IPFix. Like several
other nearby fields, they are different lengths in different versions of the spec. Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8918 svn path=/trunk/; revision=50940
-rw-r--r--epan/dissectors/packet-netflow.c38
1 files changed, 34 insertions, 4 deletions
diff --git a/epan/dissectors/packet-netflow.c b/epan/dissectors/packet-netflow.c
index fcd57e7510..cba06b12b3 100644
--- a/epan/dissectors/packet-netflow.c
+++ b/epan/dissectors/packet-netflow.c
@@ -1053,6 +1053,8 @@ static int hf_cflow_octets = -1;
static int hf_cflow_octets64 = -1;
static int hf_cflow_length_min = -1;
static int hf_cflow_length_max = -1;
+static int hf_cflow_length_min64 = -1;
+static int hf_cflow_length_max64 = -1;
static int hf_cflow_timedelta = -1;
static int hf_cflow_sys_init_time = -1;
static int hf_cflow_timestart = -1;
@@ -2782,13 +2784,31 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree,
break;
case 25: /* length_min */
- ti = proto_tree_add_item(pdutree, hf_cflow_length_min,
- tvb, offset, length, ENC_BIG_ENDIAN);
+ if (length == 2) {
+ ti = proto_tree_add_item(pdutree, hf_cflow_length_min,
+ tvb, offset, length, ENC_BIG_ENDIAN);
+ } else if (length == 8) {
+ ti = proto_tree_add_item(pdutree, hf_cflow_length_min64,
+ tvb, offset, length, ENC_BIG_ENDIAN);
+ } else {
+ ti = proto_tree_add_text(pdutree,
+ tvb, offset, length,
+ "MinLength: length %u", length);
+ }
break;
case 26: /* length_max */
- ti = proto_tree_add_item(pdutree, hf_cflow_length_max,
- tvb, offset, length, ENC_BIG_ENDIAN);
+ if (length == 2) {
+ ti = proto_tree_add_item(pdutree, hf_cflow_length_max,
+ tvb, offset, length, ENC_BIG_ENDIAN);
+ } else if (length == 8) {
+ ti = proto_tree_add_item(pdutree, hf_cflow_length_max64,
+ tvb, offset, length, ENC_BIG_ENDIAN);
+ } else {
+ ti = proto_tree_add_text(pdutree,
+ tvb, offset, length,
+ "MaxLength: length %u", length);
+ }
break;
case 27: /* IPv6 src addr */
@@ -5956,6 +5976,16 @@ proto_register_netflow(void)
FT_UINT16, BASE_DEC, NULL, 0x0,
"Packet Length Max", HFILL}
},
+ {&hf_cflow_length_min64,
+ {"MinLength", "cflow.length_min",
+ FT_UINT64, BASE_DEC, NULL, 0x0,
+ "Packet Length Min", HFILL}
+ },
+ {&hf_cflow_length_max64,
+ {"MaxLength", "cflow.length_max",
+ FT_UINT64, BASE_DEC, NULL, 0x0,
+ "Packet Length Max", HFILL}
+ },
{&hf_cflow_timedelta,
{"Duration", "cflow.timedelta",
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,