Skip to content

Commit

Permalink
Merge branch 'master' into kazuho/pacer
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuho committed Nov 4, 2023
2 parents 95f6f52 + 5d330a5 commit 2ccbb25
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
11 changes: 2 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ INCLUDE(CMakePushCheckState)
INCLUDE(CheckCSourceCompiles)
INCLUDE(deps/picotls/cmake/boringssl-adjust.cmake)
INCLUDE(deps/picotls/cmake/dtrace-utils.cmake)
INCLUDE(deps/picotls/cmake/fusion.cmake)

FIND_PACKAGE(OpenSSL REQUIRED)
BORINGSSL_ADJUST()
Expand All @@ -20,15 +21,7 @@ IF (WITH_DTRACE)
MESSAGE(STATUS "Enabling USDT support")
ENDIF ()

CMAKE_PUSH_CHECK_STATE()
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -mavx2 -maes -mpclmul -mvaes -mvpclmulqdq")
CHECK_C_SOURCE_COMPILES("int main(void) {}" CC_HAS_AESNI256)
CMAKE_POP_CHECK_STATE()
IF (CC_HAS_AESNI256)
SET(WITH_FUSION_DEFAULT "ON")
ELSE ()
SET(WITH_FUSION_DEFAULT "OFF")
ENDIF ()
CHECK_FUSION_PREREQUISITES()
OPTION(WITH_FUSION "whether or not to use the Fusion AES-GCM engine in the cli binary" ${WITH_FUSION_DEFAULT})

# CMake defaults to a Debug build, whereas quicly defaults to an optimized (Release) build
Expand Down
8 changes: 5 additions & 3 deletions lib/quicly.c
Original file line number Diff line number Diff line change
Expand Up @@ -5738,7 +5738,6 @@ static int compare_socket_address(struct sockaddr *x, struct sockaddr *y)
if (r != 0)
return r;
CMP(ntohs(xin6->sin6_port), ntohs(yin6->sin6_port));
CMP(xin6->sin6_flowinfo, yin6->sin6_flowinfo);
CMP(xin6->sin6_scope_id, yin6->sin6_scope_id);
} else if (x->sa_family == AF_UNSPEC) {
return 1;
Expand Down Expand Up @@ -6786,6 +6785,7 @@ int quicly_encrypt_address_token(void (*random_bytes)(void *, size_t), ptls_aead
break;
case AF_INET6:
ptls_buffer_pushv(buf, &plaintext->remote.sin6.sin6_addr, 16);
ptls_buffer_push32(buf, plaintext->remote.sin6.sin6_scope_id);
port = ntohs(plaintext->remote.sin6.sin6_port);
break;
default:
Expand Down Expand Up @@ -6883,9 +6883,11 @@ int quicly_decrypt_address_token(ptls_aead_context_t *aead, quicly_address_token
memcpy(&plaintext->remote.sin.sin_addr.s_addr, src, 4);
portaddr = &plaintext->remote.sin.sin_port;
break;
case 16: /* ipv6 */
plaintext->remote.sin6.sin6_family = AF_INET6;
case 20: /* ipv6 */
plaintext->remote.sin6 = (struct sockaddr_in6){.sin6_family = AF_INET6};
memcpy(&plaintext->remote.sin6.sin6_addr, src, 16);
if ((ret = ptls_decode32(&plaintext->remote.sin6.sin6_scope_id, &src, end)) != 0)
goto Exit;
portaddr = &plaintext->remote.sin6.sin6_port;
break;
default:
Expand Down

0 comments on commit 2ccbb25

Please sign in to comment.