diff --git a/src/net/AddressInfo.hxx b/src/net/AddressInfo.hxx index c53a7e343..d99925715 100644 --- a/src/net/AddressInfo.hxx +++ b/src/net/AddressInfo.hxx @@ -55,6 +55,13 @@ public: constexpr operator SocketAddress() const noexcept { return {ai_addr, (SocketAddress::size_type)ai_addrlen}; } + + /** + * Cast a #addrinfo reference to an #AddressInfo reference. + */ + static constexpr const AddressInfo &Cast(const struct addrinfo &ai) noexcept { + return static_cast(ai); + } }; class AddressInfoList {