aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-idrp.c
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2016-02-12 06:15:33 +0000
committerAnders Broman <a.broman58@gmail.com>2016-02-16 05:58:32 +0000
commitd1474f1ce8b0880bf3d7c6b4bcb8be688344df58 (patch)
tree2adae37b7c44b82134cd59dabc8b65bb391c3124 /epan/dissectors/packet-idrp.c
parent416ca6b9c9cd181e59fc9f51f9628a7d4871ba80 (diff)
IRDP: Use integer arithmetic to round-up [-Wbad-function-cast]
Change-Id: Idef58b23b7ec0b52ca10c0ce5304bf840252e043 Reviewed-on: https://code.wireshark.org/review/13935 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-idrp.c')
-rw-r--r--epan/dissectors/packet-idrp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/epan/dissectors/packet-idrp.c b/epan/dissectors/packet-idrp.c
index 045aa2cf42..65a599b031 100644
--- a/epan/dissectors/packet-idrp.c
+++ b/epan/dissectors/packet-idrp.c
@@ -713,7 +713,8 @@ static int dissect_BISPDU_UPDATE(tvbuff_t * tvb, int offset, proto_tree * tree)
for (i = nb_of_snpa; i > 0; i--) {
/* SNPS length in multiples of 4 bit */
length_indicator_guint8 =
- (guint8) ceil((float)tvb_get_guint8(tvb, offset) / (float)2.0);
+ /* length = half the length in semi-octets rounded up */
+ (tvb_get_guint8(tvb, offset) + 1) / 2;
offset += 1;
proto_tree_add_item(tree,
hf_idrp_update_path_attr_next_hop_snpa,