aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-isis-lsp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-03-31 14:47:49 -0700
committerGuy Harris <guy@alum.mit.edu>2017-03-31 21:48:25 +0000
commit02f74e47ed3e542f4aff9fc6a7a9c44e29be5c7b (patch)
tree6de9af3de29042cea7a675f2ed0441c7783381af /epan/dissectors/packet-isis-lsp.c
parent7dc065397a5a18715dd1cf70dc4cfbccb550fa90 (diff)
Fix some dissection errors.
"XXX supported" for a metric type is a Boolean, not an int; add it as such. Add the value of the item without the extra bits. The length of an address prefix is in semi-octets (nibbles/hex digits), not in octets. Change-Id: I642f0dab5030f7609e89f45cf2cff15cd74dfbda Reviewed-on: https://code.wireshark.org/review/20819 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-isis-lsp.c')
-rw-r--r--epan/dissectors/packet-isis-lsp.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/epan/dissectors/packet-isis-lsp.c b/epan/dissectors/packet-isis-lsp.c
index 34feda0aa3..2ed6cd30ba 100644
--- a/epan/dissectors/packet-isis-lsp.c
+++ b/epan/dissectors/packet-isis-lsp.c
@@ -622,9 +622,9 @@ dissect_metric(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
int s;
proto_item *item, *support_item;
- s = ISIS_LSP_CLV_METRIC_SUPPORTED(value);
- item = proto_tree_add_uint(tree, hf, tvb, offset, 1, value);
- support_item = proto_tree_add_uint(tree, hf_support, tvb, offset, 1, value);
+ s = ISIS_LSP_CLV_METRIC_SUPPORTED(value) ? TRUE : FALSE;
+ item = proto_tree_add_uint(tree, hf, tvb, offset, 1, ISIS_LSP_CLV_METRIC_VALUE(value));
+ support_item = proto_tree_add_boolean(tree, hf_support, tvb, offset, 1, s);
if (s && force_supported)
proto_item_append_text(support_item, " (but is required to be)");
@@ -3078,6 +3078,9 @@ dissect_lsp_prefix_neighbors_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *
offset += 4;
length -= 4;
while ( length > 0 ) {
+ /*
+ * This is a length in "semi-octets", i.e., in nibbles.
+ */
mylen = tvb_get_guint8(tvb, offset);
length--;
if (length<=0) {
@@ -3085,9 +3088,9 @@ dissect_lsp_prefix_neighbors_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *
"Zero payload space after length in prefix neighbor" );
return;
}
- if ( mylen > length) {
+ if ( mylen > length*2) {
proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_long_packet, tvb, offset, -1,
- "Integral length of prefix neighbor too long (%d vs %d)", mylen, length );
+ "Integral length of prefix neighbor too long (%d vs %d)", mylen, length*2 );
return;
}
@@ -3095,9 +3098,9 @@ dissect_lsp_prefix_neighbors_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *
* Lets turn the area address into "standard" 0000.0000.etc
* format string.
*/
- sbuf = print_area( tvb, offset+1, mylen );
+ sbuf = print_address_prefix( tvb, offset+1, mylen );
/* and spit it out */
- proto_tree_add_string( tree, hf_isis_lsp_area_address_str, tvb, offset, mylen + 1, sbuf);
+ proto_tree_add_string( tree, hf_isis_lsp_area_address_str, tvb, offset, (mylen+1)/2 + 1, sbuf);
offset += mylen + 1;
length -= mylen; /* length already adjusted for len fld*/