From adc5c5db8849807b7742fc01e69d224062f8323b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 21 Aug 2018 20:16:57 +0200 Subject: [PATCH] net/IPv4Address: pass reference to Cast() --- src/net/IPv4Address.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/IPv4Address.hxx b/src/net/IPv4Address.hxx index 7e6ee79f4..e57bdf4cf 100644 --- a/src/net/IPv4Address.hxx +++ b/src/net/IPv4Address.hxx @@ -172,7 +172,7 @@ public: * Return a downcasted reference to the address. This call is * only legal after verifying SocketAddress::GetFamily(). */ - static constexpr const IPv4Address &Cast(const SocketAddress src) noexcept { + static constexpr const IPv4Address &Cast(const SocketAddress &src) noexcept { /* this reinterpret_cast works because this class is just a wrapper for struct sockaddr_in6 */ return *(const IPv4Address *)(const void *)src.GetAddress();