This is an automated email from the ASF dual-hosted git repository. masaori pushed a commit to branch quic-latest in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 3f549f468bff0906230b47395c05eb7a2d8b8beb Author: Masaori Koshiba <[email protected]> AuthorDate: Fri Jun 8 11:57:04 2018 +0900 Add aead_tag_len in long packet header size calculation --- iocore/net/quic/QUICPacket.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/iocore/net/quic/QUICPacket.cc b/iocore/net/quic/QUICPacket.cc index 373de9b..247e6cd 100644 --- a/iocore/net/quic/QUICPacket.cc +++ b/iocore/net/quic/QUICPacket.cc @@ -27,7 +27,8 @@ #include "QUICPacket.h" #include "QUICDebugNames.h" -static constexpr std::string_view tag = "quic_packet"sv; +static constexpr std::string_view tag = "quic_packet"sv; +static constexpr uint64_t aead_tag_len = 16; #define QUICDebug(dcid, scid, fmt, ...) \ Debug(tag.data(), "[%08" PRIx32 "-%08" PRIx32 "] " fmt, dcid.h32(), scid.h32(), ##__VA_ARGS__); @@ -176,7 +177,7 @@ QUICPacketLongHeader::QUICPacketLongHeader(QUICPacketType type, QUICConnectionId LONG_HDR_OFFSET_CONNECTION_ID + this->_destination_cid.length() + this->_source_cid.length() + this->_payload_length; } else { this->_buf_len = LONG_HDR_OFFSET_CONNECTION_ID + this->_destination_cid.length() + this->_source_cid.length() + - QUICVariableInt::size(this->_payload_length) + 4 + this->_payload_length; + QUICVariableInt::size(this->_payload_length + aead_tag_len) + 4 + this->_payload_length; } } @@ -307,7 +308,7 @@ QUICPacketLongHeader::store(uint8_t *buf, size_t *len) const *len += n; if (this->_type != QUICPacketType::VERSION_NEGOTIATION) { - QUICIntUtil::write_QUICVariableInt(this->_payload_length + 16, buf + *len, &n); + QUICIntUtil::write_QUICVariableInt(this->_payload_length + aead_tag_len, buf + *len, &n); *len += n; QUICPacketNumber dst = 0; -- To stop receiving notification emails like this one, please contact [email protected].
