diff --git a/doc/sources/nghttpx-howto.rst b/doc/sources/nghttpx-howto.rst index cfd9311e..48faddd7 100644 --- a/doc/sources/nghttpx-howto.rst +++ b/doc/sources/nghttpx-howto.rst @@ -544,10 +544,10 @@ Algorithm described in `QUIC-LB draft `_. A Connection ID that nghttpx generates is always 20 bytes long. It uses first 2 bits as a configuration ID. The remaining bits in the -first byte are reserved and random. The next 2 bytes are server ID. -The next 6 bytes are used to route UDP datagram to a correct +first byte are reserved and random. The next 4 bytes are server ID. +The next 4 bytes are used to route UDP datagram to a correct ``SO_REUSEPORT`` socket. The remaining bytes are randomly generated. -The server ID and the next 14 bytes are encrypted with AES-ECB. The +The server ID and the next 12 bytes are encrypted with AES-ECB. The key is derived from the keying materials stored in a file specified by :option:`--frontend-quic-secret-file`. The first 2 bits of keying material in the file is used as a configuration ID. The remaining diff --git a/src/shrpx.cc b/src/shrpx.cc index f77db9fa..1cdc2c59 100644 --- a/src/shrpx.cc +++ b/src/shrpx.cc @@ -3395,8 +3395,8 @@ HTTP/3 and QUIC: Specify server ID encoded in Connection ID to identify this particular server instance. Connection ID is encrypted and this part is not visible in public. It - must be 2 bytes long and must be encoded in hex string - (which is 4 bytes long). If this option is omitted, a + must be 4 bytes long and must be encoded in hex string + (which is 8 bytes long). If this option is omitted, a random server ID is generated on startup and configuration reload. --no-quic-bpf diff --git a/src/shrpx_quic.h b/src/shrpx_quic.h index e66018c4..8f400254 100644 --- a/src/shrpx_quic.h +++ b/src/shrpx_quic.h @@ -64,7 +64,7 @@ struct QUICKeyingMaterials; struct QUICKeyingMaterial; constexpr size_t SHRPX_QUIC_SCIDLEN = 20; -constexpr size_t SHRPX_QUIC_SERVER_IDLEN = 2; +constexpr size_t SHRPX_QUIC_SERVER_IDLEN = 4; // SHRPX_QUIC_CID_PREFIXLEN includes SHRPX_QUIC_SERVER_IDLEN. constexpr size_t SHRPX_QUIC_CID_PREFIXLEN = 8; constexpr size_t SHRPX_QUIC_CID_PREFIX_OFFSET = 1;