diff --git a/epan/dissectors/packet-6lowpan.c b/epan/dissectors/packet-6lowpan.c index c2cad2c43e..a5e55c50e9 100644 --- a/epan/dissectors/packet-6lowpan.c +++ b/epan/dissectors/packet-6lowpan.c @@ -1758,7 +1758,7 @@ dissect_6lowpan_hc1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint dg /* Construct the next header for the UDP datagram. */ offset = BITS_TO_BYTE_LEN(0, bit_offset); - length = (gint)tvb_ensure_captured_length_remaining(tvb, offset); + length = tvb_captured_length_remaining(tvb, offset); nhdr_list = (struct lowpan_nhdr *)wmem_alloc(wmem_packet_scope(), sizeof(struct lowpan_nhdr) + sizeof(struct udp_hdr) + length); nhdr_list->next = NULL; nhdr_list->proto = IP_PROTO_UDP; @@ -1776,7 +1776,7 @@ dissect_6lowpan_hc1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint dg else { gint length; offset = BITS_TO_BYTE_LEN(0, bit_offset); - length = (gint)tvb_ensure_captured_length_remaining(tvb, offset); + length = tvb_captured_length_remaining(tvb, offset); nhdr_list = (struct lowpan_nhdr *)wmem_alloc(wmem_packet_scope(), sizeof(struct lowpan_nhdr) + length); nhdr_list->next = NULL; nhdr_list->proto = ipv6.ip6h_nxt; @@ -2214,7 +2214,7 @@ dissect_6lowpan_iphc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint d } /* Create an extension header for the remaining payload. */ else { - length = (gint)tvb_ensure_captured_length_remaining(tvb, offset); + length = tvb_captured_length_remaining(tvb, offset); nhdr_list = (struct lowpan_nhdr *)wmem_alloc(wmem_packet_scope(), sizeof(struct lowpan_nhdr) + length); nhdr_list->next = NULL; nhdr_list->proto = ipv6.ip6h_nxt; @@ -2424,7 +2424,7 @@ dissect_6lowpan_iphc_nhc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi } else if (ipv6_ext.ip6e_nxt != IP_PROTO_NONE) { /* Create another next header structure for the remaining payload. */ - length = (gint)tvb_ensure_captured_length_remaining(tvb, offset); + length = tvb_captured_length_remaining(tvb, offset); nhdr->next = (struct lowpan_nhdr *)wmem_alloc(wmem_packet_scope(), sizeof(struct lowpan_nhdr) + length); nhdr->next->next = NULL; nhdr->next->proto = ipv6_ext.ip6e_nxt; @@ -2571,7 +2571,7 @@ dissect_6lowpan_iphc_nhc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi #endif /* Create the next header structure for the UDP datagram. */ - length = (gint)tvb_ensure_captured_length_remaining(tvb, offset); + length = tvb_captured_length_remaining(tvb, offset); nhdr = (struct lowpan_nhdr *)wmem_alloc(wmem_packet_scope(), sizeof(struct lowpan_nhdr) + sizeof(struct udp_hdr) + length); nhdr->next = NULL; nhdr->proto = IP_PROTO_UDP;