BGP: Break off IPv6 LU NLRI into its own fields

Change-Id: I2c0b521369c30d651a39f49f72bd93986499c96e
Reviewed-on: https://code.wireshark.org/review/28559
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Vadim Fedorenko 2018-07-02 00:58:16 +03:00 committed by Anders Broman
parent 4473ec9295
commit 9ba6d3fbc0
1 changed files with 14 additions and 6 deletions

View File

@ -5239,22 +5239,30 @@ decode_prefix_MP(proto_tree *tree, int hf_path_id, int hf_addr4, int hf_addr6,
return -1;
}
/* XXX - break off IPv6 into its own field */
set_address(&addr, AT_IPv6, 16, ip6addr.bytes);
if (total_length > 0) {
proto_tree_add_string_format(tree, hf_bgp_label_stack, tvb, start_offset,
prefix_tree = proto_tree_add_subtree_format(tree, tvb, start_offset,
(offset + length) - start_offset,
wmem_strbuf_get_str(stack_strbuf), "Label Stack=%s, IPv6=%s/%u PathId %u",
ett_bgp_prefix, NULL,
"Label Stack=%s, IPv6=%s/%u PathId %u",
wmem_strbuf_get_str(stack_strbuf),
address_to_str(wmem_packet_scope(), &addr), plen, path_identifier);
proto_tree_add_item(prefix_tree, hf_path_id, tvb, start_offset, 4, ENC_BIG_ENDIAN);
start_offset += 4;
} else {
proto_tree_add_string_format(tree, hf_bgp_label_stack, tvb, start_offset,
prefix_tree = proto_tree_add_subtree_format(tree, tvb, start_offset,
(offset + length) - start_offset,
wmem_strbuf_get_str(stack_strbuf), "Label Stack=%s, IPv6=%s/%u",
ett_bgp_prefix, NULL,
"Label Stack=%s, IPv6=%s/%u",
wmem_strbuf_get_str(stack_strbuf),
address_to_str(wmem_packet_scope(), &addr), plen);
}
total_length += (1 + labnum * 3) + length;
proto_tree_add_uint_format(prefix_tree, hf_bgp_prefix_length, tvb, start_offset, 1, plen + labnum * 3 * 8,
"%s Prefix length: %u", tag, plen + labnum * 3 * 8);
proto_tree_add_string_format(prefix_tree, hf_bgp_label_stack, tvb, start_offset + 1, 3 * labnum, wmem_strbuf_get_str(stack_strbuf),
"%s Label Stack: %s", tag, wmem_strbuf_get_str(stack_strbuf));
total_length += (1 + labnum*3) + length;
proto_tree_add_ipv6(prefix_tree, hf_addr6, tvb, offset, length, &ip6addr);
break;
case SAFNUM_ENCAPSULATION:
plen = tvb_get_guint8(tvb, offset);