From dc6b9dfcd635a1ca97a218bcdaf16a2ee5f7b693 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 19 Feb 2018 21:27:03 -0800 Subject: Define macros to calculate (2^N)^M, and use them in more places. Change-Id: I4df1b35d8d2233c301f0ba9e119d012aebe9cd17 Reviewed-on: https://code.wireshark.org/review/25913 Reviewed-by: Guy Harris --- epan/dissectors/packet-icmpv6.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'epan/dissectors/packet-icmpv6.c') diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c index b4d570e13f..56633a6ee3 100644 --- a/epan/dissectors/packet-icmpv6.c +++ b/epan/dissectors/packet-icmpv6.c @@ -34,6 +34,8 @@ #include #include +#include + #include "packet-ber.h" #include "packet-dns.h" #include "packet-x509af.h" @@ -2995,7 +2997,7 @@ dissect_icmpv6_rpl_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree } } - proto_item_append_text(ti_opt_lifetime, " (%u sec)", 1U << ((lt_mr_nh & RPL_OPT_ROUTE_DISCOVERY_L) >> 6)*2); + proto_item_append_text(ti_opt_lifetime, " (%u sec)", pow4(guint32, (lt_mr_nh & RPL_OPT_ROUTE_DISCOVERY_L) >> 6)); if (!(lt_mr_nh & RPL_OPT_ROUTE_DISCOVERY_MR_NH)) { proto_item_append_text(ti_opt_mr_nh, " (Infinity)"); -- cgit v1.2.3