From 9cb9154b080aad4d290f1f7f4ef9e682e4567fc2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 20 Aug 2018 15:53:06 +0200 Subject: [PATCH] net/IPv4Address: add struct sockaddr_in constructor --- src/net/IPv4Address.hxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/net/IPv4Address.hxx b/src/net/IPv4Address.hxx index eb604d515..022519270 100644 --- a/src/net/IPv4Address.hxx +++ b/src/net/IPv4Address.hxx @@ -126,11 +126,14 @@ class IPv4Address { public: IPv4Address() = default; + constexpr IPv4Address(const struct sockaddr_in &_address) noexcept + :address(_address) {} + /** * @param port the port number in host byte order */ constexpr IPv4Address(struct in_addr _address, uint16_t port) noexcept - :address(Construct(_address, port)) {} + :IPv4Address(Construct(_address, port)) {} /** * @param port the port number in host byte order