summaryrefslogtreecommitdiffstats
path: root/libnetdutils/InternetAddresses.cpp
diff options
context:
space:
mode:
authornuccachen <nuccachen@google.com>2018-07-17 18:07:23 +0800
committerHungming Chen <nuccachen@google.com>2018-12-17 15:10:05 +0800
commitf52f7a52a8b06d240e57f35dfccbf97e14223c1b (patch)
tree16c8c1e10273db062f364b60490adf3847a2dead /libnetdutils/InternetAddresses.cpp
parente9c28e285f774efbb1241d15461a23727cf1ddd5 (diff)
downloadplatform_system_netd-f52f7a52a8b06d240e57f35dfccbf97e14223c1b.tar.gz
platform_system_netd-f52f7a52a8b06d240e57f35dfccbf97e14223c1b.tar.bz2
platform_system_netd-f52f7a52a8b06d240e57f35dfccbf97e14223c1b.zip
Synthesize DNS64 prefix in netd
Synthesize DNS64 prefix with IPv4 dns query result in the following conditions: 1. If specify address family to IPv6 and no IPv6 addresses result is obtained, then if IPv4 addresses result could be obtained 2. If address family is unspecified and query results are all IPv4 addresses Test: built, flashed, booted system/netd/tests/runtests.sh passes Bug: 78545619 Change-Id: Ia7c5963c054772f8c95b95849282e9d9d5761515
Diffstat (limited to 'libnetdutils/InternetAddresses.cpp')
-rw-r--r--libnetdutils/InternetAddresses.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libnetdutils/InternetAddresses.cpp b/libnetdutils/InternetAddresses.cpp
index ebe92e843..944ed91a7 100644
--- a/libnetdutils/InternetAddresses.cpp
+++ b/libnetdutils/InternetAddresses.cpp
@@ -120,6 +120,11 @@ IPPrefix::IPPrefix(const IPAddress& ip, int length) : IPPrefix(ip) {
}
}
+bool IPPrefix::isUninitialized() const noexcept {
+ static const internal_::compact_ipdata empty{};
+ return mData == empty;
+}
+
std::string IPPrefix::toString() const noexcept {
return StringPrintf("%s/%d", ip().toString().c_str(), mData.cidrlen);
}