net: dns: Ignore queries when resolving a name
It might happen that while we are waiting for the response to one of our query, we receive a query to resolve another name. Previously this would make the current name resolution to fail because only responses were expected to be received. Signed-off-by: Léonard Bise <leonard.bise@gmail.com>
This commit is contained in:
parent
4f7f6c96be
commit
7b869f0392
1 changed files with 8 additions and 0 deletions
|
@ -406,6 +406,14 @@ static int dns_read(struct dns_resolve_context *ctx,
|
|||
goto quit;
|
||||
}
|
||||
|
||||
/* We might receive a query while we are waiting for a response, in that
|
||||
* case we just ignore the query instead of making the resolving fail.
|
||||
*/
|
||||
if (dns_header_qr(dns_msg.msg) == DNS_QUERY) {
|
||||
ret = 0;
|
||||
goto quit;
|
||||
}
|
||||
|
||||
ret = dns_unpack_response_header(&dns_msg, *dns_id);
|
||||
if (ret < 0) {
|
||||
ret = DNS_EAI_FAIL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue