Use folly::IPAddress::hash instead of gethostid
[folly.git] / folly / IPAddressV4.cpp
index d66993c4bde13d359e205881ac3f71e08a44e195..418620459b964f69be9e7cfc6fb5cb1e4e3cb794 100644 (file)
@@ -144,11 +144,18 @@ bool IPAddressV4::inSubnetWithMask(const IPAddressV4& subnet,
   return (mask == subMask);
 }
 
+// public
 bool IPAddressV4::isLoopback() const {
   static IPAddressV4 loopback_addr("127.0.0.0");
   return inSubnetWithMask(loopback_addr, fetchMask(8));
 }
 
+// public
+bool IPAddressV4::isLinkLocal() const {
+  static IPAddressV4 linklocal_addr("169.254.0.0");
+  return inSubnetWithMask(linklocal_addr, fetchMask(16));
+}
+
 // public
 bool IPAddressV4::isNonroutable() const {
   auto ip = toLongHBO();