udns_resolver.c:916: dns_submit_dn: Assertion `q->dnsq_origdnl0 > 0' failed.
Michael Tokarev
mjt at tls.msk.ru
Tue Jul 5 18:10:42 MSD 2011
05.07.2011 18:05, Michael Tokarev wrote:
> 05.07.2011 17:46, Iñaki Baz Castillo wrote:
>> 2011/7/5 Iñaki Baz Castillo <ibc at aliax.net>:
>>> Hi, note that I don't mean "a._" but "a. _" (with space, so you must
>>> enclose the string between "" to pass it as a single argument to the
>>> call).
>>> Sorry, I was wrong, please use ".a _".
>>
>> I've tested your code with "a. _" and produces:
>>
>> .a _: valid domain but no data of requested type
>>
>> However in my Ruby C extension (which uses udns asyncronously) it
>> produces ("today") a timeout so tempfail.
>
> Actually I found the problem. the srv rr submitter does not
> check validity of the names it were asked to resolve. The
> following patch should fix the issue.
And this patch should work better yet.
diff --git a/udns_rr_srv.c b/udns_rr_srv.c
index 1b72f2e..38f1122 100644
--- a/udns_rr_srv.c
+++ b/udns_rr_srv.c
@@ -87,9 +87,8 @@ dns_parse_srv(dnscc_t *qdn, dnscc_t *pkt, dnscc_t *cur, dnscc_t *end,
* according to rfc2782 rules.
* Return 0 or the label length.
* Routing assumes dn holds enouth space for a single DN label. */
-static unsigned add_sname(dnsc_t *dn, const char *sn) {
- unsigned l;
- l = dns_ptodn(sn, 0, dn + 1, DNS_MAXLABEL-1, NULL);
+static int add_sname(dnsc_t *dn, const char *sn) {
+ int l = dns_ptodn(sn, 0, dn + 1, DNS_MAXLABEL-1, NULL);
if (l <= 1 || l - 2 != dn[1])
/* Should we really check if sn is exactly one label? Do we care? */
return 0;
@@ -107,8 +106,7 @@ static unsigned add_sname(dnsc_t *dn, const char *sn) {
static int
build_srv_dn(dnsc_t *dn, const char *name, const char *srv, const char *proto)
{
- unsigned p = 0, l;
- int isabs;
+ int p = 0, l, isabs;
if (srv) {
l = add_sname(dn + p, srv);
if (!l)
@@ -122,7 +120,7 @@ build_srv_dn(dnsc_t *dn, const char *name, const char *srv, const char *proto)
p += l;
}
l = dns_ptodn(name, 0, dn + p, DNS_MAXDN - p, &isabs);
- if (!l)
+ if (l < 0)
return -1;
return isabs ? DNS_NOSRCH : 0;
}
More information about the udns
mailing list