Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package aws-c-io for openSUSE:Factory checked in at 2025-07-23 16:35:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/aws-c-io (Old) and /work/SRC/openSUSE:Factory/.aws-c-io.new.8875 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "aws-c-io" Wed Jul 23 16:35:36 2025 rev:26 rq:1295232 version:0.21.2 Changes: -------- --- /work/SRC/openSUSE:Factory/aws-c-io/aws-c-io.changes 2025-07-15 16:44:45.881958419 +0200 +++ /work/SRC/openSUSE:Factory/.aws-c-io.new.8875/aws-c-io.changes 2025-07-23 16:39:13.333653519 +0200 @@ -1,0 +2,9 @@ +Tue Jul 22 08:28:25 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaub...@suse.com> + +- Update to version 0.21.2 + * aws_parse_ipv4/6_address by @TingDaoK in (#745) +- from version 0.21.1 + * Stop packing future variable to avoid tsan data race warnings + by @DmitriyMusatkin in (#741) + +------------------------------------------------------------------- Old: ---- v0.21.0.tar.gz New: ---- v0.21.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ aws-c-io.spec ++++++ --- /var/tmp/diff_new_pack.p6KVmq/_old 2025-07-23 16:39:13.953678384 +0200 +++ /var/tmp/diff_new_pack.p6KVmq/_new 2025-07-23 16:39:13.953678384 +0200 @@ -21,7 +21,7 @@ %define library_version 1.0.0 %define library_soversion 0unstable Name: aws-c-io -Version: 0.21.0 +Version: 0.21.2 Release: 0 Summary: I/O and TLS package AWS SDK for C License: Apache-2.0 ++++++ v0.21.0.tar.gz -> v0.21.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-io-0.21.0/include/aws/io/socket.h new/aws-c-io-0.21.2/include/aws/io/socket.h --- old/aws-c-io-0.21.0/include/aws/io/socket.h 2025-07-10 18:30:30.000000000 +0200 +++ new/aws-c-io-0.21.2/include/aws/io/socket.h 2025-07-18 00:45:22.000000000 +0200 @@ -209,6 +209,7 @@ struct aws_byte_buf; struct aws_byte_cursor; +struct aws_string; AWS_EXTERN_C_BEGIN @@ -428,6 +429,40 @@ */ AWS_IO_API enum aws_socket_impl_type aws_socket_get_default_impl_type(void); +/** + * Parse an IPv4 address string and convert it to binary representation. + * + * This function converts a string representation of an IPv4 address + * into its binary network byte order (big-endian) representation. + * + * @param src The IPv4 address string to parse. Must be a valid IPv4 address in dotted decimal notation. + * @param dst Pointer to a uint32_t where the parsed address will be stored in network byte order. + * + * @return AWS_OP_SUCCESS on success, or AWS_OP_ERR on failure. + * On failure, aws_last_error() will be set to: + * - AWS_IO_SOCKET_INVALID_ADDRESS if the input string is not a valid IPv4 address + */ +AWS_IO_API int aws_parse_ipv4_address(const struct aws_string *src, uint32_t *dst); + +/** + * Parse an IPv6 address string and convert it to binary representation. + * + * This function converts a string representation of an IPv6 address + * into its binary network byte order(big-endian) representation. + * + * @param src The IPv6 address string to parse. Must be a valid IPv6 address in standard notation. + * @param dst Pointer to an aws_byte_buf where the parsed address will be appended. + * The buffer must have at least 16 bytes of available capacity. + * The parsed 16-byte IPv6 address will be appended to the buffer and + * the buffer's length will be increased by 16. + * + * @return AWS_OP_SUCCESS on success, or AWS_OP_ERR on failure. + * On failure, aws_last_error() will be set to: + * - AWS_IO_SOCKET_INVALID_ADDRESS if the input string is not a valid IPv6 address + * - AWS_ERROR_SHORT_BUFFER if the destination buffer doesn't have enough capacity + */ +AWS_IO_API int aws_parse_ipv6_address(const struct aws_string *src, struct aws_byte_buf *dst); + AWS_EXTERN_C_END AWS_POP_SANE_WARNING_LEVEL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-io-0.21.0/source/future.c new/aws-c-io-0.21.2/source/future.c --- old/aws-c-io-0.21.0/source/future.c 2025-07-10 18:30:30.000000000 +0200 +++ new/aws-c-io-0.21.2/source/future.c 2025-07-18 00:45:22.000000000 +0200 @@ -47,12 +47,11 @@ aws_future_impl_result_release_fn *release; } result_dtor; int error_code; - /* sum of bit fields should be 32 */ -#define BIT_COUNT_FOR_SIZEOF_RESULT 27 - unsigned int sizeof_result : BIT_COUNT_FOR_SIZEOF_RESULT; - unsigned int type : 3; /* aws_future_type */ - unsigned int is_done : 1; - unsigned int owns_result : 1; + + size_t sizeof_result; + enum aws_future_type type; + bool is_done; + bool owns_result; }; static void s_future_impl_result_dtor(struct aws_future_impl *future, void *result_addr) { @@ -108,9 +107,7 @@ struct aws_future_impl *future = aws_mem_calloc(alloc, 1, total_size); future->alloc = alloc; - /* we store sizeof_result in a bit field, ensure the number will fit */ - AWS_ASSERT(sizeof_result <= (UINT_MAX >> (32 - BIT_COUNT_FOR_SIZEOF_RESULT))); - future->sizeof_result = (unsigned int)sizeof_result; + future->sizeof_result = sizeof_result; aws_ref_count_init(&future->ref_count, future, s_future_impl_destroy); aws_mutex_init(&future->lock); @@ -186,7 +183,7 @@ /* BEGIN CRITICAL SECTION */ aws_mutex_lock(mutable_lock); - bool is_done = future->is_done != 0; + bool is_done = future->is_done; aws_mutex_unlock(mutable_lock); /* END CRITICAL SECTION */ @@ -362,7 +359,7 @@ AWS_FATAL_ASSERT(future->callback.fn == NULL && "Future done callback must only be set once"); - bool already_done = future->is_done != 0; + bool already_done = future->is_done; /* if not done, store callback for later */ if (!already_done) { @@ -456,7 +453,7 @@ static bool s_future_impl_is_done_pred(void *user_data) { struct aws_future_impl *future = user_data; - return future->is_done != 0; + return future->is_done; } bool aws_future_impl_wait(const struct aws_future_impl *future, uint64_t timeout_ns) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-io-0.21.0/source/posix/socket.c new/aws-c-io-0.21.2/source/posix/socket.c --- old/aws-c-io-0.21.0/source/posix/socket.c 2025-07-10 18:30:30.000000000 +0200 +++ new/aws-c-io-0.21.2/source/posix/socket.c 2025-07-18 00:45:22.000000000 +0200 @@ -2133,3 +2133,26 @@ } return true; } + +int aws_parse_ipv4_address(const struct aws_string *src, uint32_t *dst) { + int result = inet_pton(AF_INET, aws_string_c_str(src), dst); + if (result != 1) { + int errno_value = errno; /* Always cache errno before potential side-effect */ + return aws_raise_error(s_convert_pton_error(result, errno_value)); + } + return AWS_OP_SUCCESS; +} +int aws_parse_ipv6_address(const struct aws_string *src, struct aws_byte_buf *dst) { + /* IPV6 requires 16 bytes */ + size_t result_length = 16; + if (dst->capacity - dst->len < result_length) { + return aws_raise_error(AWS_ERROR_SHORT_BUFFER); + } + int result = inet_pton(AF_INET6, aws_string_c_str(src), dst->buffer + dst->len); + if (result != 1) { + int errno_value = errno; /* Always cache errno before potential side-effect */ + return aws_raise_error(s_convert_pton_error(result, errno_value)); + } + dst->len += result_length; + return AWS_OP_SUCCESS; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-io-0.21.0/source/windows/iocp/socket.c new/aws-c-io-0.21.2/source/windows/iocp/socket.c --- old/aws-c-io-0.21.0/source/windows/iocp/socket.c 2025-07-10 18:30:30.000000000 +0200 +++ new/aws-c-io-0.21.2/source/windows/iocp/socket.c 2025-07-18 00:45:22.000000000 +0200 @@ -3398,3 +3398,24 @@ AWS_LOGF_ERROR(AWS_LS_IO_SOCKET, "network_interface_names are not supported on Windows"); return false; } + +int aws_parse_ipv4_address(const struct aws_string *src, uint32_t *dst) { + int result = inet_pton(AF_INET, aws_string_c_str(src), dst); + if (result != 1) { + return aws_raise_error(s_convert_pton_error(result)); + } + return AWS_OP_SUCCESS; +} +int aws_parse_ipv6_address(const struct aws_string *src, struct aws_byte_buf *dst) { + /* IPV6 requires 16 bytes */ + size_t result_length = 16; + if (dst->capacity - dst->len < result_length) { + return aws_raise_error(AWS_ERROR_SHORT_BUFFER); + } + int result = inet_pton(AF_INET6, aws_string_c_str(src), dst->buffer + dst->len); + if (result != 1) { + return aws_raise_error(s_convert_pton_error(result)); + } + dst->len += result_length; + return AWS_OP_SUCCESS; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-io-0.21.0/tests/CMakeLists.txt new/aws-c-io-0.21.2/tests/CMakeLists.txt --- old/aws-c-io-0.21.0/tests/CMakeLists.txt 2025-07-10 18:30:30.000000000 +0200 +++ new/aws-c-io-0.21.2/tests/CMakeLists.txt 2025-07-18 00:45:22.000000000 +0200 @@ -89,6 +89,11 @@ add_test_case(sock_write_cb_is_async) add_test_case(socket_validate_port) +add_test_case(parse_ipv4_valid_addresses) +add_test_case(parse_ipv4_invalid_addresses) +add_test_case(parse_ipv6_valid_addresses) +add_test_case(parse_ipv6_invalid_addresses) + if(NOT AWS_USE_APPLE_NETWORK_FRAMEWORK) # Apple Network Framework does not support bind+connect add_test_case(udp_bind_connect_communication) @@ -97,7 +102,7 @@ # Apple Network Framework would not validate the binding endpoint until we start the # listen. The test does not apply here. add_test_case(incoming_duplicate_tcp_bind_errors) -# nw_socket does not allow clean up event loop before socket shutdown, thus the following tests triggered +# nw_socket does not allow clean up event loop before socket shutdown, thus the following tests triggered # by event loop shutdown would not apply to Apple Network Framework add_net_test_case(connect_timeout_cancelation) add_net_test_case(cleanup_before_connect_or_timeout_doesnt_explode) @@ -309,7 +314,7 @@ add_test_case(alpn_error_creating_handler) add_test_case(tls_destroy_null_context) add_net_test_case(tls_certificate_chain_test) - + else() add_test_case(byo_tls_handler_test) endif() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/aws-c-io-0.21.0/tests/socket_test.c new/aws-c-io-0.21.2/tests/socket_test.c --- old/aws-c-io-0.21.0/tests/socket_test.c 2025-07-10 18:30:30.000000000 +0200 +++ new/aws-c-io-0.21.2/tests/socket_test.c 2025-07-18 00:45:22.000000000 +0200 @@ -2667,3 +2667,137 @@ return 0; } AWS_TEST_CASE(socket_validate_port, s_test_socket_validate_port) + +static int s_test_parse_ipv4_valid_addresses(struct aws_allocator *allocator, void *ctx) { + (void)ctx; + + struct { + const char *input; + uint32_t expected_network_order; + } test_cases[] = { + {"127.0.0.1", htonl(0x7F000001)}, /* localhost */ + {"0.0.0.0", htonl(0x00000000)}, /* any address */ + {"255.255.255.255", htonl(0xFFFFFFFF)}, /* broadcast */ + {"192.168.1.1", htonl(0xC0A80101)}, /* common private IP */ + {"10.0.0.1", htonl(0x0A000001)}, /* private IP */ + {"172.16.0.1", htonl(0xAC100001)}, /* private IP */ + {"8.8.8.8", htonl(0x08080808)}, /* Google DNS */ + {"1.2.3.4", htonl(0x01020304)}, /* simple test case */ + }; + + for (size_t i = 0; i < AWS_ARRAY_SIZE(test_cases); i++) { + uint32_t result; + struct aws_string *addr_str = aws_string_new_from_c_str(allocator, test_cases[i].input); + ASSERT_SUCCESS(aws_parse_ipv4_address(addr_str, &result)); + ASSERT_INT_EQUALS(test_cases[i].expected_network_order, result, "Failed for %s", test_cases[i].input); + aws_string_destroy(addr_str); + } + + return AWS_OP_SUCCESS; +} + +AWS_TEST_CASE(parse_ipv4_valid_addresses, s_test_parse_ipv4_valid_addresses) + +static int s_test_parse_ipv4_invalid_addresses(struct aws_allocator *allocator, void *ctx) { + (void)ctx; + + const char *invalid_addresses[] = { + "", /* empty string */ + "256.1.1.1", /* octet > 255 */ + "1.1.1", /* too few octets */ + "1.1.1.1.1", /* too many octets */ + "1.1.1.a", /* non-numeric */ + "1..1.1", /* empty octet */ + "192.168.1.-1", /* negative number */ + "not.an.ip.address", /* clearly not an IP */ + "2001:db8::1", /* IPv6 address */ + }; + + for (size_t i = 0; i < AWS_ARRAY_SIZE(invalid_addresses); i++) { + uint32_t result; + struct aws_string *addr_str = aws_string_new_from_c_str(allocator, invalid_addresses[i]); + ASSERT_FAILS(aws_parse_ipv4_address(addr_str, &result), "Failed for %s", invalid_addresses[i]); + ASSERT_INT_EQUALS(AWS_IO_SOCKET_INVALID_ADDRESS, aws_last_error(), "Wrong error for %s", invalid_addresses[i]); + aws_string_destroy(addr_str); + } + + return AWS_OP_SUCCESS; +} + +AWS_TEST_CASE(parse_ipv4_invalid_addresses, s_test_parse_ipv4_invalid_addresses) + +static int s_test_parse_ipv6_valid_addresses(struct aws_allocator *allocator, void *ctx) { + (void)ctx; + + struct { + const char *input; + uint8_t expected[16]; + } test_cases[] = { + // {"::1", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}}, /* loopback */ + {"::", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* any address */ + {"2001:db8:85a3::8a2e:370:7334", + {0x20, + 0x01, + 0x0d, + 0xb8, + 0x85, + 0xa3, + 0x00, + 0x00, + 0x00, + 0x00, + 0x8a, + 0x2e, + 0x03, + 0x70, + 0x73, + 0x34}}, /* compressed + */ + {"::ffff:192.168.1.1", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 192, 168, 1, 1}}, /* IPv4-mapped */ + {"fe80::1", {0xfe, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}}, /* link-local */ + }; + + struct aws_byte_buf result; + aws_byte_buf_init(&result, allocator, 16); + for (size_t i = 0; i < AWS_ARRAY_SIZE(test_cases); i++) { + struct aws_string *addr_str = aws_string_new_from_c_str(allocator, test_cases[i].input); + ASSERT_SUCCESS(aws_parse_ipv6_address(addr_str, &result), "Failed for %s", test_cases[i].input); + struct aws_byte_cursor expected = aws_byte_cursor_from_array(test_cases[i].expected, 16); + ASSERT_TRUE(aws_byte_cursor_eq_byte_buf(&expected, &result)); + aws_string_destroy(addr_str); + aws_byte_buf_reset(&result, false); + } + aws_byte_buf_clean_up(&result); + return AWS_OP_SUCCESS; +} + +AWS_TEST_CASE(parse_ipv6_valid_addresses, s_test_parse_ipv6_valid_addresses) + +static int s_test_parse_ipv6_invalid_addresses(struct aws_allocator *allocator, void *ctx) { + (void)ctx; + + const char *invalid_addresses[] = { + "", /* empty string */ + ":::", /* too many colons */ + "2001:db8:85a3::8a2e::7334", /* multiple :: */ + "2001:db8:85a3:0000:0000:8a2e:0370:7334:extra", /* too many groups */ + "2001:db8:85a3:0000:0000:8a2e:0370:733g", /* invalid hex digit */ + "192.168.1.1", /* IPv4 address */ + "not:an:ipv6:address", /* clearly not IPv6 */ + "gggg::1", /* invalid hex characters */ + }; + + struct aws_byte_buf result; + aws_byte_buf_init(&result, allocator, 16); + for (size_t i = 0; i < AWS_ARRAY_SIZE(invalid_addresses); i++) { + struct aws_string *addr_str = aws_string_new_from_c_str(allocator, invalid_addresses[i]); + ASSERT_FAILS(aws_parse_ipv6_address(addr_str, &result), "Failed for %s", invalid_addresses[i]); + ASSERT_INT_EQUALS(AWS_IO_SOCKET_INVALID_ADDRESS, aws_last_error(), "Wrong error for %s", invalid_addresses[i]); + aws_string_destroy(addr_str); + aws_byte_buf_reset(&result, false); + } + aws_byte_buf_clean_up(&result); + return AWS_OP_SUCCESS; +} + +AWS_TEST_CASE(parse_ipv6_invalid_addresses, s_test_parse_ipv6_invalid_addresses)