patch from richard:

this patch fix an issue with stateless sip requests.

In some scenarios (depending of DNS replies), the request
is being terminated before the message is sent. This patch
fixes the issue. 

For stateless requests, if A/AAAA records for target of SRV record
is not present in addl (additional list) of NAPTR/SRV DNS reply, we
will explicitly query for those.
This commit is contained in:
Alfred E. Heggestad 2016-06-21 10:41:08 +00:00
parent 85ed43afd1
commit 64d5123da7

View file

@ -259,6 +259,11 @@ static int request_next(struct sip_request *req)
if (req->addrl.head || req->srvl.head)
goto again;
}
else if (!req->stateful) {
req->resph = NULL;
terminate(req, 0, NULL);
mem_deref(req);
}
return err;
}
@ -427,12 +432,6 @@ static void naptr_handler(int err, const struct dnshdr *hdr, struct list *ansl,
if (err)
goto fail;
if (!req->stateful) {
req->resph = NULL;
terminate(req, 0, NULL);
mem_deref(req);
}
return;
fail:
@ -487,12 +486,6 @@ static void srv_handler(int err, const struct dnshdr *hdr, struct list *ansl,
if (err)
goto fail;
if (!req->stateful) {
req->resph = NULL;
terminate(req, 0, NULL);
mem_deref(req);
}
return;
fail:
@ -525,12 +518,6 @@ static void addr_handler(int err, const struct dnshdr *hdr, struct list *ansl,
if (err)
goto fail;
if (!req->stateful) {
req->resph = NULL;
terminate(req, 0, NULL);
mem_deref(req);
}
return;
fail: