From 10aed80b29d9e22f08f22398f33f9723aa999607 Mon Sep 17 00:00:00 2001 From: Peter Brottveit Bock Date: Tue, 30 May 2023 00:25:28 +0200 Subject: [PATCH] AK: Define IPv6Address::loopback(), the IPv6 loopback address '::1' --- AK/IPv6Address.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/AK/IPv6Address.h b/AK/IPv6Address.h index e2e59dd6f94..34bcb646e6b 100644 --- a/AK/IPv6Address.h +++ b/AK/IPv6Address.h @@ -251,6 +251,12 @@ public: return {}; } + // https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.3 + [[nodiscard]] static IPv6Address loopback() + { + return IPv6Address({ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }); + } + private: constexpr u16 group(unsigned i) const {