| aa358ce3 | 20-Oct-2025 |
John Baldwin <jhb@FreeBSD.org> |
inet_net_test: Compare pointers against nullptr
GCC does not like passing NULL (__null) to std::ostringstream::operator<< inside of ATF_REQUIRE_EQ:
lib/libc/tests/net/inet_net_test.cc: In member fu
inet_net_test: Compare pointers against nullptr
GCC does not like passing NULL (__null) to std::ostringstream::operator<< inside of ATF_REQUIRE_EQ:
lib/libc/tests/net/inet_net_test.cc: In member function 'virtual void {anonymous}::atfu_tc_inet_net_ntop_invalid::body() const': lib/libc/tests/net/inet_net_test.cc:306:9: error: passing NULL to non-pointer argument 1 of 'std::__1::basic_ostream<_CharT, _Traits>& std::__1::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::__1::char_traits<char>]' [-Werror=conversion-null] 306 | ATF_REQUIRE_EQ(ret, NULL); | ^~~~~~~~~~~~~~ In file included from /usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/sstream:317, from /usr/obj/.../amd64.amd64/tmp/usr/include/atf-c++/macros.hpp:29, from /usr/obj/.../amd64.amd64/tmp/usr/include/atf-c++.hpp:29, from lib/libc/tests/net/inet_net_test.cc:33: /usr/obj/.../amd64.amd64/tmp/usr/include/c++/v1/__ostream/basic_ostream.h:338:81: note: declared here 338 | basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(long __n) { | ~~~~~^~~ ...
Fixes: 8f4a0d2f7b96 ("libc: Import OpenBSD's inet_net_{ntop,pton}")
show more ...
|
| 4b990663 | 06-Apr-2025 |
K Rin <rin@sandb0x.tw> |
libc/tests: fix couple errors for getaddrinfo_test
- The reason our test is flaky is its dependence on ip6addrctl_policy. - While here, fix shell logic. When our diff(1) prints a diff it returns
libc/tests: fix couple errors for getaddrinfo_test
- The reason our test is flaky is its dependence on ip6addrctl_policy. - While here, fix shell logic. When our diff(1) prints a diff it returns a nonzero status and this is when we want to atf_fail().
show more ...
|
| d803854b | 28-Mar-2025 |
Gleb Smirnoff <glebius@FreeBSD.org> |
libc/getaddrinfo(2): return EAI_AGAIN on nameserver timeout
A nameserver timeout is a soft failure, future attempts may succeed. Returning EAI_AGAIN is crucial for API users to tell a soft name reso
libc/getaddrinfo(2): return EAI_AGAIN on nameserver timeout
A nameserver timeout is a soft failure, future attempts may succeed. Returning EAI_AGAIN is crucial for API users to tell a soft name resolution failure from negative resolution result.
Before the change we would return EAI_ADDRFAMILY, which I believe, is a regression from 144361386696, and before that revision we used to return EAI_NONAME in most of the cases.
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D49411
show more ...
|
| 53134577 | 28-Mar-2025 |
Gleb Smirnoff <glebius@FreeBSD.org> |
libc/tests: add getaddrinfo test
A test suite for getaddrinfo(3) written in C. Unlike NetBSD test, this one will be mostly focused on what the API should return when something isn't good with your
libc/tests: add getaddrinfo test
A test suite for getaddrinfo(3) written in C. Unlike NetBSD test, this one will be mostly focused on what the API should return when something isn't good with your DNS. Test emulates bad DNS servers in resolv.conf intercepting fopen(2) and emulates downed network intercepting send(2).
Initial version covers three main scenarios: all good, server(s) timed out, network down. For each scenario we test hostname with trailing dot and without, since libc resolver uses quite different code paths, sometimes even yielding with different error codes. All current error codes in the test are what our libc returns right now, meaning the test documents what we have, not what there should be.
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D49410
show more ...
|