Make netlink dissector register the attribute length header field info

The header field info variable named hfi_netlink_len isn't registered
by the netlink dissector, but is added to the tree, resulting in a
runtime error. This commit changes the variable name slightly, to
be more accurate, and correctly registers it.

Bug: 10884
Change-Id: Iaa4e556d5bbe87b72a0cdca2fbf397fa95e074cc
Reviewed-on: https://code.wireshark.org/review/6751
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Hadriel Kaplan 2015-01-22 22:40:01 -05:00 committed by Anders Broman
parent 407b7034e3
commit 888229bebd
1 changed files with 6 additions and 3 deletions

View File

@ -110,8 +110,8 @@ static header_field_info hfi_netlink_hdr_pid NETLINK_HFI_INIT =
{ "Port ID", "netlink.hdr_pid", FT_UINT32, BASE_HEX,
NULL, 0x00, NULL, HFILL };
static header_field_info hfi_netlink_len NETLINK_HFI_INIT =
{ "Len", "netlink.len", FT_UINT16, BASE_DEC,
static header_field_info hfi_netlink_attr_len NETLINK_HFI_INIT =
{ "Len", "netlink.attr_len", FT_UINT16, BASE_DEC,
NULL, 0x00, NULL, HFILL };
static gint ett_netlink_cooked = -1;
@ -144,7 +144,7 @@ dissect_netlink_attributes(tvbuff_t *tvb, header_field_info *hfi_type, int ett,
attr_tree = proto_tree_add_subtree(tree, tvb, offset, end_offset - offset, ett, &ti, "Attribute");
proto_tree_add_item(attr_tree, &hfi_netlink_len, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(attr_tree, &hfi_netlink_attr_len, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
rta_type = tvb_get_letohs(tvb, offset);
@ -288,6 +288,9 @@ proto_register_netlink(void)
&hfi_netlink_hdr_flags,
&hfi_netlink_hdr_seq,
&hfi_netlink_hdr_pid,
/* Netlink message attribute */
&hfi_netlink_attr_len,
};
#endif