From 3dafc007a95ae89904e0e92dc86ed27205de05c5 Mon Sep 17 00:00:00 2001 From: Loïc Blot Date: Fri, 15 Feb 2019 12:27:29 +0100 Subject: LINT fix --- src/network/address.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/network') diff --git a/src/network/address.cpp b/src/network/address.cpp index fce3b48f0..896b24317 100644 --- a/src/network/address.cpp +++ b/src/network/address.cpp @@ -272,7 +272,8 @@ void Address::print(std::ostream *s) const *s << serializeString() << ":" << m_port; } -bool Address::isLocalhost() const { +bool Address::isLocalhost() const +{ if (isIPv6()) { static const unsigned char localhost_bytes[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; @@ -281,8 +282,10 @@ bool Address::isLocalhost() const { auto addr = m_address.ipv6.sin6_addr.s6_addr; +// clang-format off return memcmp(addr, localhost_bytes, 16) == 0 || memcmp(addr, mapped_ipv4_localhost, 13) == 0; +// clang-format on } return (m_address.ipv4.sin_addr.s_addr & 0xFF) == 0x7f; -- cgit v1.2.3