Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upServe stale #159
Serve stale #159
Conversation
This comment has been minimized.
This comment has been minimized.
jedisct1
commented on a48c3c7
Nov 24, 2019
|
What is the patent situation with this? |
This comment has been minimized.
This comment has been minimized.
|
The IPR for this draft is published here: https://datatracker.ietf.org/ipr/search/?id=draft-ietf-dnsop-serve-stale&submit=draft "Royalty-Free, Reasonable and Non-Discriminatory License to All Implementers" |
| /* Check if we are allowed to return expired entries: | ||
| * - serve_expired needs to be set | ||
| * - if SERVE_EXPIRED_TTL is set make sure that the record is not older | ||
| * than that. */ | ||
| if((time_t)expiry < *qstate->env->now && | ||
| !qstate->env->cfg->serve_expired) | ||
| (!qstate->env->cfg->serve_expired || | ||
| (SERVE_EXPIRED_TTL && | ||
| *qstate->env->now - (time_t)expiry > SERVE_EXPIRED_TTL))) |
This comment has been minimized.
This comment has been minimized.
wcawijngaards
Feb 3, 2020
Member
If time_t is unsigned, the now - expiry is going to be a large number, and thus give the wrong outcome. Perhaps rewrite to like now > constant + expiry that does not have the subtraction. Or add a test that now > expiry, that could actually be in the if statement at the start, but I am not sure all cases have it.
This comment has been minimized.
This comment has been minimized.
wcawijngaards
Feb 3, 2020
Member
Actually, it is safe, in the cases of the if-statement (in those cases the subtraction has a positive outcome), but on its own it would not be.
| } | ||
| if(rep->c->tcp_req_info) { | ||
| if(!tcp_req_info_add_meshstate(rep->c->tcp_req_info, mesh, s)) { | ||
| log_err("mesh_new_client: out of memory add tcpreqinfo"); | ||
| goto servfail_mem; | ||
| } | ||
| } | ||
| /* add serve expired timer if required and not already there */ | ||
| if(timeout && !mesh_serve_expired_init(s, timeout)) { |
This comment has been minimized.
This comment has been minimized.
wcawijngaards
Feb 3, 2020
Member
This exits the routine when out of memory, but does not print an error message. Also inside mesh_serve_expired_init there is no error message (eg. for the regional_alloc call).
This comment has been minimized.
This comment has been minimized.
| /** TTL for the serve expired replies */ | ||
| int serve_expired_reply_ttl; | ||
| /** serve expired entries only after trying to update the entries and this | ||
| * timeout is reached */ |
This comment has been minimized.
This comment has been minimized.
wcawijngaards
Feb 3, 2020
Member
add in milliseconds. Also the serve_expired_reply_ttl and serve_expired_client_timeout do not have a recommended value shown (commented out) in doc/example.conf.in.
This comment has been minimized.
This comment has been minimized.
| * qstate: the query state. | ||
| * lookup_qinfo: the qinfo to lookup for. | ||
| */ | ||
| typedef struct dns_msg* serve_expired_lookup_func_type( |
This comment has been minimized.
This comment has been minimized.
wcawijngaards
Feb 3, 2020
Member
It would be nice to have a fptr_wlist item for this func_type to check for the possible allowed values.
This comment has been minimized.
This comment has been minimized.
|
Looks good! Thanks for looking into the zero TTL case. |
gthess commentedFeb 3, 2020
No description provided.