AK: Disable implicit conversion from char* -> ipv4 -> ipv6

This is a footgun with some massive bullets.
This commit is contained in:
Ali Mohammad Pur 2024-11-01 23:49:54 +01:00 committed by Ali Mohammad Pur
parent 8a07131229
commit b93d8ef875
Notes: github-actions[bot] 2024-11-20 20:44:49 +00:00

View file

@ -29,6 +29,15 @@ public:
m_data[i] = data[i]; m_data[i] = data[i];
} }
constexpr IPv6Address(Array<u8, 16> const& data)
{
for (size_t i = 0; i < 16; i++)
m_data[i] = data[i];
}
template<SameAs<char const*> T>
constexpr IPv6Address(T const&) = delete; // Disable implicit conversion of char const* -> ipv4 -> ipv6
constexpr IPv6Address(IPv4Address const& ipv4_address) constexpr IPv6Address(IPv4Address const& ipv4_address)
{ {
// IPv4 mapped IPv6 address // IPv4 mapped IPv6 address