rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | diff --git a/bionic/libc/dns/resolv/res_state.c b/bionic/libc/dns/resolv/res_state.c |
| 2 | index 16185b3..747467d 100644 |
| 3 | --- a/bionic/libc/dns/resolv/res_state.c |
| 4 | +++ b/bionic/libc/dns/resolv/res_state.c |
| 5 | @@ -116,32 +116,7 @@ _res_thread_get(void) |
| 6 | rt = pthread_getspecific( _res_key ); |
| 7 | |
| 8 | if (rt != NULL) { |
| 9 | - /* We already have one thread-specific DNS state object. |
| 10 | - * Check the serial value for any changes to net.* properties */ |
| 11 | - D("%s: Called for tid=%d rt=%p rt->pi=%p rt->serial=%d", |
| 12 | - __FUNCTION__, gettid(), rt, rt->_pi, rt->_serial); |
| 13 | - if (rt->_pi == NULL) { |
| 14 | - /* The property wasn't created when _res_thread_get() was |
| 15 | - * called the last time. This should only happen very |
| 16 | - * early during the boot sequence. First, let's try to see if it |
| 17 | - * is here now. */ |
| 18 | - //rt->_pi = (struct prop_info*) __system_property_find("net.change"); |
| 19 | - //if (rt->_pi == NULL) { |
| 20 | - /* Still nothing, return current state */ |
| 21 | - // D("%s: exiting for tid=%d rt=%d since system property not found", |
| 22 | - // __FUNCTION__, gettid(), rt); |
| 23 | - // return rt; |
| 24 | - //} |
| 25 | - } |
| 26 | - //if (rt->_serial == __system_property_serial(rt->_pi)) { |
| 27 | - /* Nothing changed, so return the current state */ |
| 28 | - // D("%s: tid=%d rt=%p nothing changed, returning", |
| 29 | - // __FUNCTION__, gettid(), rt); |
| 30 | - // return rt; |
| 31 | - //} |
| 32 | - /* Update the recorded serial number, and go reset the state */ |
| 33 | - //rt->_serial = __system_property_serial(rt->_pi); |
| 34 | - goto RESET_STATE; |
| 35 | + return rt; |
| 36 | } |
| 37 | |
| 38 | /* It is the first time this function is called in this thread, |
| 39 | @@ -154,11 +129,10 @@ _res_thread_get(void) |
| 40 | D("%s: tid=%d Created new DNS state rt=%p", |
| 41 | __FUNCTION__, gettid(), rt); |
| 42 | |
| 43 | -RESET_STATE: |
| 44 | /* Reset the state, note that res_ninit() can now properly reset |
| 45 | * an existing state without leaking memory. |
| 46 | */ |
| 47 | - D("%s: tid=%d, rt=%p, resetting DNS state (options RES_INIT=%d)", |
| 48 | + D("%s: tid=%d, rt=%p, setting DNS state (options RES_INIT=%d)", |
| 49 | __FUNCTION__, gettid(), rt, (rt->_nres->options & RES_INIT) != 0); |
| 50 | if ( res_ninit( rt->_nres ) < 0 ) { |
| 51 | /* This should not happen */ |
| 52 | diff --git a/bionic/libc/include/resolv.h b/bionic/libc/include/resolv.h |
| 53 | index 75f1f18..b0e030e 100644 |
| 54 | --- a/bionic/libc/include/resolv.h |
| 55 | +++ b/bionic/libc/include/resolv.h |
| 56 | @@ -90,7 +90,7 @@ typedef res_sendhookact (*res_send_rhook) (const struct sockaddr_in *__ns, |
| 57 | /* |
| 58 | * Global defines and variables for resolver stub. |
| 59 | */ |
| 60 | -# define MAXNS 3 /* max # name servers we'll track */ |
| 61 | +# define MAXNS 4 /* max # name servers we'll track */ |
| 62 | # define MAXDFLSRCH 3 /* # default domain levels to try */ |
| 63 | # define MAXDNSRCH 6 /* max # domains in search path */ |
| 64 | # define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */ |