Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 253ea334 authored by Luke Huang's avatar Luke Huang Committed by Gerrit Code Review
Browse files

Merge "Set rcode correctly for caching hit"

parents 403c0440 83c9b4b6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -385,6 +385,8 @@ int res_nsend(res_state statp, const u_char* buf, int buflen, u_char* ans, int a
    cache_status = _resolv_cache_lookup(statp->netid, buf, buflen, ans, anssiz, &anslen, flags);

    if (cache_status == RESOLV_CACHE_FOUND) {
        HEADER* hp = (HEADER*)(void*)ans;
        *rcode = hp->rcode;
        return anslen;
    } else if (cache_status != RESOLV_CACHE_UNSUPPORTED) {
        // had a cache miss for a known network, so populate the thread private