net/IPv6Address: pass reference to Cast()

This commit is contained in:
Max Kellermann 2018-08-21 20:21:41 +02:00
parent adc5c5db88
commit dda5516eec

View File

@ -124,7 +124,7 @@ public:
* Return a downcasted reference to the address. This call is
* only legal after verifying SocketAddress::GetFamily().
*/
static constexpr const IPv6Address &Cast(const SocketAddress src) noexcept {
static constexpr const IPv6Address &Cast(const SocketAddress &src) noexcept {
/* this reinterpret_cast works because this class is
just a wrapper for struct sockaddr_in6 */
return *(const IPv6Address *)(const void *)src.GetAddress();