From 7e66261fd9f5d7f06cc46edfb36890c67d47b195 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Fri, 17 Feb 2023 17:01:01 -0700 Subject: [PATCH] IP_Hdr: take length value as uint64_t instead of int --- src/IP.cc | 3 ++- src/IP.h | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/IP.cc b/src/IP.cc index 88ba8c2741..315f5e4dd0 100644 --- a/src/IP.cc +++ b/src/IP.cc @@ -536,7 +536,8 @@ IPv6_Hdr_Chain::~IPv6_Hdr_Chain() delete finalDst; } -void IPv6_Hdr_Chain::Init(const struct ip6_hdr* ip6, int total_len, bool set_next, uint16_t next) +void IPv6_Hdr_Chain::Init(const struct ip6_hdr* ip6, uint64_t total_len, bool set_next, + uint16_t next) { length = 0; uint8_t current_type, next_type; diff --git a/src/IP.h b/src/IP.h index c2cd9ca2f8..40d1ba574d 100644 --- a/src/IP.h +++ b/src/IP.h @@ -162,7 +162,7 @@ public: /** * Initializes the header chain from an IPv6 header structure. */ - IPv6_Hdr_Chain(const struct ip6_hdr* ip6, int len) { Init(ip6, len, false); } + IPv6_Hdr_Chain(const struct ip6_hdr* ip6, uint64_t len) { Init(ip6, len, false); } ~IPv6_Hdr_Chain(); @@ -250,7 +250,7 @@ protected: * Initializes the header chain from an IPv6 header structure, and replaces * the first next protocol pointer field that points to a fragment header. */ - IPv6_Hdr_Chain(const struct ip6_hdr* ip6, uint16_t next, int len) + IPv6_Hdr_Chain(const struct ip6_hdr* ip6, uint16_t next, uint64_t len) { Init(ip6, len, true, next); } @@ -260,7 +260,7 @@ protected: * length, possibly setting the first next protocol pointer field that * points to a fragment header. */ - void Init(const struct ip6_hdr* ip6, int total_len, bool set_next, uint16_t next = 0); + void Init(const struct ip6_hdr* ip6, uint64_t total_len, bool set_next, uint16_t next = 0); /** * Process a routing header and allocate/remember the final destination @@ -324,8 +324,8 @@ public: * @param c an already-constructed header chain to take ownership of. * @param reassembled whether this header is for a reassembled packet. */ - IP_Hdr(const struct ip6_hdr* arg_ip6, bool arg_del, int len, const IPv6_Hdr_Chain* c = nullptr, - bool reassembled = false) + IP_Hdr(const struct ip6_hdr* arg_ip6, bool arg_del, uint64_t len, + const IPv6_Hdr_Chain* c = nullptr, bool reassembled = false) : ip6(arg_ip6), ip6_hdrs(c ? c : new IPv6_Hdr_Chain(ip6, len)), del(arg_del), reassembled(reassembled) {