обратный резолвер, cname

Igor Sysoev is at rambler-co.ru
Fri Jan 30 14:53:55 MSK 2009


On Fri, Jan 30, 2009 at 03:06:10PM +0600, Artem Bokhan wrote:

> Похоже на проблемы в обратном резолвере
> 
> 
> 2009/01/30 14:57:25 [error] 5545#0: *15448 74.72-79.???X ! could not be 
> resolved (3: Host not found) while in resolving client hostname, client: 
> 200.149.10.74, server: 0.0.0.0:33333

Нет, дело не в cname. Патч прилагается, использовать вместе с предыдущим.


-- 
Игорь Сысоев
http://sysoev.ru
-------------- next part --------------
Index: src/core/ngx_resolver.c
===================================================================
--- src/core/ngx_resolver.c	(revision 1805)
+++ src/core/ngx_resolver.c	(working copy)
@@ -1516,24 +1516,23 @@
         goto short_response;
     }
 
-    len -= 2;
-
     if (ngx_resolver_copy(r, &name, buf, &buf[i], &buf[n]) != NGX_OK) {
         return;
     }
 
     ngx_log_debug1(NGX_LOG_DEBUG_CORE, r->log, 0, "resolver an:%V", &name);
 
-    if (len != (size_t) rn->nlen || ngx_strncmp(name.data, rn->name, len) != 0)
+    if (name.len != (size_t) rn->nlen
+        || ngx_strncmp(name.data, rn->name, name.len) != 0)
     {
         if (rn->nlen) {
             ngx_resolver_free(r, rn->name);
         }
 
-        rn->nlen = len;
+        rn->nlen = name.len;
         rn->name = name.data;
 
-        name.data = ngx_resolver_dup(r, rn->name, len);
+        name.data = ngx_resolver_dup(r, rn->name, name.len);
         if (name.data == NULL) {
             goto failed;
         }


More information about the nginx-ru mailing list