Loading resolv_private.h +6 −2 Original line number Diff line number Diff line Loading @@ -169,16 +169,20 @@ android::net::NsType getQueryType(const uint8_t* msg, size_t msgLen); android::net::IpVersion ipFamilyToIPVersion(int ipFamily); inline void resolv_tag_socket(int sock, uid_t uid, pid_t pid) { // This is effectively equivalent to testing for R+ if (android::net::gResNetdCallbacks.tagSocket != nullptr) { if (int err = android::net::gResNetdCallbacks.tagSocket(sock, TAG_SYSTEM_DNS, uid, pid)) { LOG(WARNING) << "Failed to tag socket: " << strerror(-err); } } // R+, since fchown() incompatible with Q's ebpf vpn isolation feature if (android::net::gApiLevel >= 30) { if (fchown(sock, uid, -1) == -1) { LOG(WARNING) << "Failed to chown socket: " << strerror(errno); } } } inline std::string addrToString(const sockaddr_storage* addr) { char out[INET6_ADDRSTRLEN] = {0}; Loading Loading
resolv_private.h +6 −2 Original line number Diff line number Diff line Loading @@ -169,16 +169,20 @@ android::net::NsType getQueryType(const uint8_t* msg, size_t msgLen); android::net::IpVersion ipFamilyToIPVersion(int ipFamily); inline void resolv_tag_socket(int sock, uid_t uid, pid_t pid) { // This is effectively equivalent to testing for R+ if (android::net::gResNetdCallbacks.tagSocket != nullptr) { if (int err = android::net::gResNetdCallbacks.tagSocket(sock, TAG_SYSTEM_DNS, uid, pid)) { LOG(WARNING) << "Failed to tag socket: " << strerror(-err); } } // R+, since fchown() incompatible with Q's ebpf vpn isolation feature if (android::net::gApiLevel >= 30) { if (fchown(sock, uid, -1) == -1) { LOG(WARNING) << "Failed to chown socket: " << strerror(errno); } } } inline std::string addrToString(const sockaddr_storage* addr) { char out[INET6_ADDRSTRLEN] = {0}; Loading