aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-netflow.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2011-10-20 02:38:40 +0000
committerGuy Harris <guy@alum.mit.edu>2011-10-20 02:38:40 +0000
commita03cc7137b3bc9807a158f5a97ee1a0910f35bf9 (patch)
tree4d943cff993c0c6cfdaae842257464f055def6a1 /epan/dissectors/packet-netflow.c
parentab7ec88be559a78e696ab98d8a692bbf64746fbd (diff)
As bug 3954 notes, nowhere does RFC 3954 indicate that a system or
interface scope is always 4 bytes. For that matter, nowhere does it indicate that the scopes have any particular interpretation except as a sequence of octets. Get rid of the checks for a length of 4, and make ScopeSystem an FT_BYTES. If, by *convention*, they're usually IPv4 or IPv6 addresses, somebody can throw in code to display them as such if they happen to be 4 or 16 bytes, respectively. Leave ScopeInterface as an integer for now, in case, by convention, they're interface indices, but still leave the length check out. Fixes bug 3954. svn path=/trunk/; revision=39485
Diffstat (limited to 'epan/dissectors/packet-netflow.c')
-rw-r--r--epan/dissectors/packet-netflow.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/epan/dissectors/packet-netflow.c b/epan/dissectors/packet-netflow.c
index 8beac73dba..aeab7c7f4a 100644
--- a/epan/dissectors/packet-netflow.c
+++ b/epan/dissectors/packet-netflow.c
@@ -2324,7 +2324,7 @@ dissect_v9_v10_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree, int o
}
static guint
-dissect_v9_pdu_scope(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree, int offset,
+dissect_v9_pdu_scope(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *pdutree, int offset,
struct v9_v10_template *tplt)
{
int orig_offset;
@@ -2347,18 +2347,10 @@ dissect_v9_pdu_scope(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree, int
case 1: /* system */
ti = proto_tree_add_item(pdutree, hf_cflow_scope_system,
tvb, offset, length, ENC_NA);
- if (length != 4) {
- expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_WARN,
- "ScopeSystem: invalid size %u", length);
- }
break;
case 2: /* interface */
ti = proto_tree_add_item(pdutree, hf_cflow_scope_interface,
- tvb, offset, length, ENC_BIG_ENDIAN);
- if (length != 4) {
- expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_WARN,
- "ScopeInterface: invalid size %u", length);
- }
+ tvb, offset, length, ENC_NA);
break;
case 3: /* linecard */
proto_tree_add_item(pdutree, hf_cflow_scope_linecard,
@@ -7197,7 +7189,7 @@ proto_register_netflow(void)
*/
{&hf_cflow_scope_system,
{"ScopeSystem", "cflow.scope_system",
- FT_IPv4, BASE_NONE, NULL, 0x0,
+ FT_BYTES, BASE_NONE, NULL, 0x0,
"Option Scope System", HFILL}
},
{&hf_cflow_scope_interface,