trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From masa...@apache.org
Subject [trafficserver] 02/08: draft-08: Support short header packet type & format
Date Wed, 13 Dec 2017 23:44:34 GMT
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 624c5c7e3274717667db4faf796867e8bc89d1ce
Author: Masaori Koshiba <masaori@apache.org>
AuthorDate: Tue Dec 12 16:08:08 2017 +0900

    draft-08: Support short header packet type & format
---
 iocore/net/quic/QUICPacket.cc           | 2 +-
 iocore/net/quic/QUICTypes.h             | 8 ++++----
 iocore/net/quic/test/test_QUICPacket.cc | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/iocore/net/quic/QUICPacket.cc b/iocore/net/quic/QUICPacket.cc
index 3fbc20f..7bf6e81 100644
--- a/iocore/net/quic/QUICPacket.cc
+++ b/iocore/net/quic/QUICPacket.cc
@@ -386,7 +386,7 @@ bool
 QUICPacketShortHeader::has_connection_id() const
 {
   if (this->_buf) {
-    return (this->_buf[0] & 0x40) != 0;
+    return (this->_buf[0] & 0x40) == 0;
   } else {
     return this->_has_connection_id;
   }
diff --git a/iocore/net/quic/QUICTypes.h b/iocore/net/quic/QUICTypes.h
index 09557e8..130bbd6 100644
--- a/iocore/net/quic/QUICTypes.h
+++ b/iocore/net/quic/QUICTypes.h
@@ -76,10 +76,10 @@ enum class QUICPacketType : uint8_t {
 
 // To detect length of Packet Number
 enum class QUICPacketShortHeaderType : int {
-  ONE = 1,
-  TWO,
-  THREE,
-  UNINITIALIZED,
+  ONE           = 0x1F,
+  TWO           = 0x1E,
+  THREE         = 0x1D,
+  UNINITIALIZED = 0x1C,
 };
 
 // XXX If you add or remove QUICFrameType, you might also need to change QUICFrame::type(const
uint8_t *)
diff --git a/iocore/net/quic/test/test_QUICPacket.cc b/iocore/net/quic/test/test_QUICPacket.cc
index ee25cb0..e4877dd 100644
--- a/iocore/net/quic/test/test_QUICPacket.cc
+++ b/iocore/net/quic/test/test_QUICPacket.cc
@@ -93,7 +93,7 @@ TEST_CASE("QUICPacketHeader", "[quic]")
   SECTION("Short Header (load)")
   {
     const uint8_t input[] = {
-      0x43,                                           // Short header, with Connection ID,
KeyPhse 0, Type
+      0x1D,                                           // Short header with (C=0, K=0, Type=0x1D)
       0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, // Connection ID
       0x12, 0x34, 0x56, 0x78,                         // Packet number
       0xff, 0xff,                                     // Payload (dummy)

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>.

Mime
View raw message