diff options
author | Mauro Sardara <msardara@cisco.com> | 2021-02-10 14:26:52 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2021-02-10 14:26:52 +0000 |
commit | 71a5c399d8064e2aa97a047e23174bb784eea399 (patch) | |
tree | 740bae933895ab6c40db1eb14fcd84a67536df06 /libtransport/src/core/portal.h | |
parent | db76bbc76c8d2cb2d817df8c9233937d230a1ff2 (diff) | |
parent | 8d08f8dd79ac12874ba0da6b26973f5a33163131 (diff) |
Merge "[HICN-679] Do not throw exception when receiving corrupted/not-hicn packet from network layer"v21.01-rc0
Diffstat (limited to 'libtransport/src/core/portal.h')
-rw-r--r-- | libtransport/src/core/portal.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libtransport/src/core/portal.h b/libtransport/src/core/portal.h index 364a36577..b63eab3af 100644 --- a/libtransport/src/core/portal.h +++ b/libtransport/src/core/portal.h @@ -96,13 +96,13 @@ class HandlerAllocator { HandlerAllocator(const HandlerAllocator<U> &other) noexcept : memory_(other.memory_) {} - TRANSPORT_ALWAYS_INLINE bool operator==(const HandlerAllocator &other) const - noexcept { + TRANSPORT_ALWAYS_INLINE bool operator==( + const HandlerAllocator &other) const noexcept { return &memory_ == &other.memory_; } - TRANSPORT_ALWAYS_INLINE bool operator!=(const HandlerAllocator &other) const - noexcept { + TRANSPORT_ALWAYS_INLINE bool operator!=( + const HandlerAllocator &other) const noexcept { return &memory_ != &other.memory_; } @@ -139,7 +139,7 @@ class CustomAllocatorHandler { } template <typename... Args> - void operator()(Args &&... args) { + void operator()(Args &&...args) { handler_(std::forward<Args>(args)...); } @@ -548,7 +548,8 @@ class Portal { return; } - Packet::Format format = Packet::getFormatFromBuffer(packet_buffer->data()); + Packet::Format format = Packet::getFormatFromBuffer( + packet_buffer->data(), packet_buffer->length()); if (TRANSPORT_EXPECT_TRUE(_is_tcp(format))) { if (!Packet::isInterest(packet_buffer->data())) { |