From: Erik Kline Date: Sun, 17 Jul 2016 19:02:07 +0000 (+0900) Subject: Add tetherApplyDnsInterfaces() binder interface. X-Git-Tag: android-x86-7.1-r1~31 X-Git-Url: http://git.osdn.net/view?p=android-x86%2Fsystem-netd.git;a=commitdiff_plain;h=212c405c296ed869eda927e683734aff80248872 Add tetherApplyDnsInterfaces() binder interface. Bug: 9580643 Change-Id: I781a422c969deb153bc8370edda4578612af6dc6 --- diff --git a/server/NetdNativeService.cpp b/server/NetdNativeService.cpp index 5ee8202..10629ef 100644 --- a/server/NetdNativeService.cpp +++ b/server/NetdNativeService.cpp @@ -201,5 +201,12 @@ binder::Status NetdNativeService::getResolverInfo(int32_t netId, return binder::Status::ok(); } +binder::Status NetdNativeService::tetherApplyDnsInterfaces(bool *ret) { + NETD_BIG_LOCK_RPC(CONNECTIVITY_INTERNAL); + + *ret = gCtls->tetherCtrl.applyDnsInterfaces(); + return binder::Status::ok(); +} + } // namespace net } // namespace android diff --git a/server/NetdNativeService.h b/server/NetdNativeService.h index b5c8f69..c5d9114 100644 --- a/server/NetdNativeService.h +++ b/server/NetdNativeService.h @@ -47,6 +47,9 @@ class NetdNativeService : public BinderService, public BnNetd binder::Status getResolverInfo(int32_t netId, std::vector* servers, std::vector* domains, std::vector* params, std::vector* stats) override; + + // Tethering-related commands. + binder::Status tetherApplyDnsInterfaces(bool *ret) override; }; } // namespace net diff --git a/server/TetherController.h b/server/TetherController.h index 6035c25..3769890 100644 --- a/server/TetherController.h +++ b/server/TetherController.h @@ -54,9 +54,9 @@ public: int tetherInterface(const char *interface); int untetherInterface(const char *interface); const std::list &getTetheredInterfaceList() const; + bool applyDnsInterfaces(); private: - bool applyDnsInterfaces(); bool setIpFwdEnabled(); }; diff --git a/server/binder/android/net/INetd.aidl b/server/binder/android/net/INetd.aidl index 097f98a..1b901b8 100644 --- a/server/binder/android/net/INetd.aidl +++ b/server/binder/android/net/INetd.aidl @@ -145,4 +145,14 @@ interface INetd { */ void getResolverInfo(int netId, out @utf8InCpp String[] servers, out @utf8InCpp String[] domains, out int[] params, out int[] stats); + + /** + * Instruct the tethering DNS server to reevaluated serving interfaces. + * This is needed to for the DNS server to observe changes in the set + * of potential listening IP addresses. (Listening on wildcard addresses + * can turn the device into an open resolver; b/7530468) + * + * TODO: Return something richer than just a boolean. + */ + boolean tetherApplyDnsInterfaces(); }