diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2016-01-16 17:01:07 +0100 |
---|---|---|
committer | Martin Kaiser <wireshark@kaiser.cx> | 2016-01-16 16:48:02 +0000 |
commit | 0aa4359be6f083f5dd0b496a3eaa324db4d989e4 (patch) | |
tree | 450dc3ff16ec4fcfb7ef15c0adb3f4f4434d715f /epan/dissectors/packet-sll.c | |
parent | d326eb98f616a94ef328656ae6df9ff8f08ac2b5 (diff) |
[sll] add LINUX_SLL_P_NETLINK
remove some unnecessary if(tree) checks while at it
Change-Id: I2ed7153a25a96f9fa08476176980655117aae26e
Reviewed-on: https://code.wireshark.org/review/13334
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan/dissectors/packet-sll.c')
-rw-r--r-- | epan/dissectors/packet-sll.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/epan/dissectors/packet-sll.c b/epan/dissectors/packet-sll.c index f2c1cab08d..a36ead52d6 100644 --- a/epan/dissectors/packet-sll.c +++ b/epan/dissectors/packet-sll.c @@ -72,6 +72,7 @@ static const value_string ltype_vals[] = { { LINUX_SLL_P_IRDA_LAP, "IrDA LAP" }, { LINUX_SLL_P_ISI, "ISI" }, { LINUX_SLL_P_IEEE802154, "IEEE 802.15.4" }, + { LINUX_SLL_P_NETLINK, "Netlink" }, { 0, NULL } }; @@ -166,7 +167,7 @@ dissect_sll(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) guint16 hatype, halen; proto_item *ti; tvbuff_t *next_tvb; - proto_tree *fh_tree = NULL; + proto_tree *fh_tree; ethertype_data_t ethertype_data; col_set_str(pinfo->cinfo, COL_PROTOCOL, "SLL"); @@ -194,12 +195,10 @@ dissect_sll(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) col_add_str(pinfo->cinfo, COL_INFO, val_to_str(pkttype, packet_type_vals, "Unknown (%u)")); - if (tree) { - ti = proto_tree_add_protocol_format(tree, hfi_sll->id, tvb, 0, - SLL_HEADER_SIZE, "Linux cooked capture"); - fh_tree = proto_item_add_subtree(ti, ett_sll); - proto_tree_add_item(fh_tree, &hfi_sll_pkttype, tvb, 0, 2, ENC_BIG_ENDIAN); - } + ti = proto_tree_add_protocol_format(tree, hfi_sll->id, tvb, 0, + SLL_HEADER_SIZE, "Linux cooked capture"); + fh_tree = proto_item_add_subtree(ti, ett_sll); + proto_tree_add_item(fh_tree, &hfi_sll_pkttype, tvb, 0, 2, ENC_BIG_ENDIAN); /* * XXX - check the link-layer address type value? @@ -207,10 +206,9 @@ dissect_sll(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) */ hatype = tvb_get_ntohs(tvb, 2); halen = tvb_get_ntohs(tvb, 4); - if (tree) { - proto_tree_add_uint(fh_tree, &hfi_sll_hatype, tvb, 2, 2, hatype); - proto_tree_add_uint(fh_tree, &hfi_sll_halen, tvb, 4, 2, halen); - } + proto_tree_add_uint(fh_tree, &hfi_sll_hatype, tvb, 2, 2, hatype); + proto_tree_add_uint(fh_tree, &hfi_sll_halen, tvb, 4, 2, halen); + switch (halen) { case 4: set_address_tvb(&pinfo->dl_src, AT_IPv4, 4, tvb, 6); |